update
This commit is contained in:
21
engine/tests/test_schema.py
Normal file
21
engine/tests/test_schema.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import json
|
||||
|
||||
from engine.schema import AnalysisResult, Environment, SCHEMA_VERSION, WallTime
|
||||
|
||||
|
||||
def test_analysis_result_serializes_to_json():
|
||||
r = AnalysisResult(
|
||||
schemaVersion=SCHEMA_VERSION,
|
||||
environment=Environment(python="3.9.19", platform="win32", processor="x86", timerResolution=1e-7),
|
||||
config={},
|
||||
status="ok",
|
||||
error=None,
|
||||
wallTime=WallTime(seconds=0.105, unit="s"),
|
||||
functions=[],
|
||||
flame=None,
|
||||
)
|
||||
data = json.loads(r.to_json())
|
||||
assert data["schemaVersion"] == SCHEMA_VERSION
|
||||
assert data["status"] == "ok"
|
||||
assert data["wallTime"]["seconds"] == 0.105
|
||||
assert data["environment"]["python"] == "3.9.19"
|
||||
Reference in New Issue
Block a user