mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-28 06:02:13 +03:00
tests: Move 'plain_no_softwarename' message into conftest.py
This commit is contained in:
parent
4b6f22d9fd
commit
73cdcc4c60
@ -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": {
|
||||
|
@ -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\">]")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user