mirror of
https://github.com/EDCD/EDDN.git
synced 2026-10-29 01:16:03 +03:00
tests: Remove hard-coded test messages. Use the files, Luke.
This commit is contained in:
1 file changed
-83
@@ -6,89 +6,6 @@ from typing import Callable, Optional
|
||||
|
||||
import pytest
|
||||
|
||||
"""A dictionary of test messages, all in string form."""
|
||||
test_messages = {
|
||||
######################################################################
|
||||
# Examples of invalid messages.
|
||||
######################################################################
|
||||
'invalid_json': '{not real json',
|
||||
|
||||
'plain_outdated_schema': '''{
|
||||
"$schemaRef": "http://schemas.elite-markets.net/eddn/journal/1",
|
||||
"header": {
|
||||
"uploaderID": "outdated schema",
|
||||
"softwareName": "pytest:src/",
|
||||
"softwareVersion": "v0.0.1"
|
||||
},
|
||||
"message": {
|
||||
}
|
||||
}''',
|
||||
|
||||
'plain_no_softwarename': '''{
|
||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
||||
"header": {
|
||||
"uploaderID": "no softwareName",
|
||||
"softwareVersion": "v0.0.1"
|
||||
},
|
||||
"message": {
|
||||
}
|
||||
}''',
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# journal/1 'scan' messages
|
||||
######################################################################
|
||||
# Example journal/1 'scan' valid message.
|
||||
'plain_journal_scan_valid': '''{
|
||||
"$schemaRef": "https://eddn.edcd.io/schemas/journal/1",
|
||||
"header": {
|
||||
"uploaderID": "valid journal message",
|
||||
"softwareName": "pytest:src/",
|
||||
"softwareVersion": "v0.0.1"
|
||||
},
|
||||
"message": {
|
||||
"timestamp":"2021-11-05T15:46:28Z",
|
||||
"event":"Scan",
|
||||
"StarSystem":"Elphin",
|
||||
"StarPos":[-30.12500,8.18750,-17.00000],
|
||||
"SystemAddress":3932076118738
|
||||
}
|
||||
}''',
|
||||
######################################################################
|
||||
|
||||
######################################################################
|
||||
# commodity/3 messages
|
||||
######################################################################
|
||||
# Example commodity/3 valid message.
|
||||
'plain_commodity_valid': '''{
|
||||
"$schemaRef": "https://eddn.edcd.io/schemas/commodity/3",
|
||||
"header": {
|
||||
"uploaderID": "valid journal message",
|
||||
"softwareName": "pytest:src/",
|
||||
"softwareVersion": "v0.0.1"
|
||||
},
|
||||
"message": {
|
||||
"timestamp":"2021-11-05T15:46:28Z",
|
||||
"systemName":"LP 98-132",
|
||||
"stationName":"Freeport",
|
||||
"marketId":128008448,
|
||||
"commodities":[
|
||||
{
|
||||
"name":"$platinum_name;",
|
||||
"buyPrice":39557,
|
||||
"sellPrice":39555,
|
||||
"meanPrice":58263,
|
||||
"stockBracket":0,
|
||||
"demandBracket":0,
|
||||
"stock":0,
|
||||
"demand":0
|
||||
}
|
||||
]
|
||||
}
|
||||
}''',
|
||||
######################################################################
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def eddn_message() -> Callable:
|
||||
|
||||
Reference in new issue
Block a user