mirror of
https://github.com/EDCD/EDDN.git
synced 2025-05-05 01:21:02 +03:00
tests: Gateway: parse_and_error_handle: Valid journal/scan message
This commit is contained in:
parent
ba43199a5d
commit
87c79a3427
@ -52,3 +52,25 @@ def test_fail_validation_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\">]")
|
||||
|
||||
def test_valid_journal_scan():
|
||||
msg = """
|
||||
{
|
||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
||||
"header": {
|
||||
"uploaderID": "valid journal message",
|
||||
"softwareName": "pytest:Gateway.parse_and_error_handle",
|
||||
"softwareVersion": "v0.0.1"
|
||||
},
|
||||
"message": {
|
||||
"timestamp":"2021-11-05T15:46:28Z",
|
||||
"event":"Scan",
|
||||
"StarSystem":"Elphin",
|
||||
"StarPos":[-30.12500,8.18750,-17.00000],
|
||||
"SystemAddress":3932076118738
|
||||
}
|
||||
}
|
||||
"""
|
||||
res = eddn.Gateway.parse_and_error_handle(msg.encode(encoding="utf-8"))
|
||||
assert res == "OK"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user