mirror of
https://github.com/EDCD/EDDN.git
synced 2025-05-01 07:31:32 +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': '''{
|
'plain_journal_scan_valid': '''{
|
||||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
||||||
"header": {
|
"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:
|
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."""
|
"""Test detecting a message with no softwareName in the message."""
|
||||||
msg = """
|
msg = eddn_message('plain_no_softwarename')
|
||||||
{
|
|
||||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
|
||||||
"header": {
|
|
||||||
"uploaderID": "no softwareName",
|
|
||||||
"softwareVersion": "v0.0.1"
|
|
||||||
},
|
|
||||||
"message": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
res = eddn_gateway.parse_and_error_handle(msg.encode(encoding="utf-8"))
|
res = eddn_gateway.parse_and_error_handle(msg.encode(encoding="utf-8"))
|
||||||
assert res.startswith("FAIL: Schema Validation: [<ValidationError: \"'softwareName' is a required property\">]")
|
assert res.startswith("FAIL: Schema Validation: [<ValidationError: \"'softwareName' is a required property\">]")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user