tests: Move 'plain_no_softwarename' message into conftest.py

This commit is contained in:
Athanasius 2022-08-19 17:21:59 +01:00
parent 4b6f22d9fd
commit 73cdcc4c60
No known key found for this signature in database
GPG Key ID: 8C392035DD80FD62
2 changed files with 11 additions and 11 deletions

View File

@ -18,6 +18,16 @@ test_messages = {
}
}''',
'plain_no_softwarename': '''{
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
"header": {
"uploaderID": "no softwareName",
"softwareVersion": "v0.0.1"
},
"message": {
}
}''',
'plain_journal_scan_valid': '''{
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
"header": {

View File

@ -47,17 +47,7 @@ def test_outdated_schema(fix_sys_path, eddn_gateway, eddn_message: Callable) ->
def test_fail_validation_no_softwarename(fix_sys_path, eddn_gateway, eddn_message: Callable) -> None:
"""Test detecting a message with no softwareName in the message."""
msg = """
{
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
"header": {
"uploaderID": "no softwareName",
"softwareVersion": "v0.0.1"
},
"message": {
}
}
"""
msg = eddn_message('plain_no_softwarename')
res = eddn_gateway.parse_and_error_handle(msg.encode(encoding="utf-8"))
assert res.startswith("FAIL: Schema Validation: [<ValidationError: \"'softwareName' is a required property\">]")