mirror of
https://github.com/EDCD/EDDN.git
synced 2025-05-03 16:41:33 +03:00
tests: Move 'plain_outdated_schema' message into conftest.py
This commit is contained in:
parent
795480f097
commit
4b6f22d9fd
@ -7,6 +7,17 @@ import pytest
|
|||||||
test_messages = {
|
test_messages = {
|
||||||
'invalid_json': '{not real json',
|
'invalid_json': '{not real json',
|
||||||
|
|
||||||
|
'plain_outdated_schema': '''{
|
||||||
|
"$schemaRef": "http://schemas.elite-markets.net/eddn/journal/1",
|
||||||
|
"header": {
|
||||||
|
"uploaderID": "outdated schema",
|
||||||
|
"softwareName": "pytest:Gateway.parse_and_error_handle",
|
||||||
|
"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": {
|
||||||
@ -21,7 +32,9 @@ test_messages = {
|
|||||||
"StarPos":[-30.12500,8.18750,-17.00000],
|
"StarPos":[-30.12500,8.18750,-17.00000],
|
||||||
"SystemAddress":3932076118738
|
"SystemAddress":3932076118738
|
||||||
}
|
}
|
||||||
}'''
|
}''',
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,20 +37,12 @@ def test_invalid_json(fix_sys_path, eddn_gateway, eddn_message: Callable) -> Non
|
|||||||
|
|
||||||
def test_outdated_schema(fix_sys_path, eddn_gateway, eddn_message: Callable) -> None:
|
def test_outdated_schema(fix_sys_path, eddn_gateway, eddn_message: Callable) -> None:
|
||||||
"""Test attempt to use an outdated schema."""
|
"""Test attempt to use an outdated schema."""
|
||||||
msg = """
|
msg = eddn_message('plain_outdated_schema')
|
||||||
{
|
|
||||||
"$schemaRef": "http://schemas.elite-markets.net/eddn/journal/1",
|
|
||||||
"header": {
|
|
||||||
"uploaderID": "outdated schema",
|
|
||||||
"softwareName": "pytest:Gateway.parse_and_error_handle",
|
|
||||||
"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: Outdated Schema: The schema you have used is no longer supported. Please check for an updated version of your application.")
|
assert res.startswith(
|
||||||
|
"FAIL: Outdated Schema: The schema you have used is no longer supported."
|
||||||
|
" Please check for an updated version of your application."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user