mirror of
https://github.com/EDCD/EDDN.git
synced 2026-11-12 01:32:22 +03:00
tests: Move 'plain_outdated_schema' message into conftest.py
This commit is contained in:
2 files changed
+19
-14
No files matched your search
+14
-1
@@ -7,6 +7,17 @@ import pytest
|
||||
test_messages = {
|
||||
'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': '''{
|
||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
||||
"header": {
|
||||
@@ -21,7 +32,9 @@ test_messages = {
|
||||
"StarPos":[-30.12500,8.18750,-17.00000],
|
||||
"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:
|
||||
"""Test attempt to use an outdated schema."""
|
||||
msg = """
|
||||
{
|
||||
"$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": {
|
||||
}
|
||||
}
|
||||
"""
|
||||
msg = eddn_message('plain_outdated_schema')
|
||||
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:
|
||||
|
||||
Reference in new issue
Block a user