diff options
| author | J08nY | 2022-01-05 01:02:56 +0100 |
|---|---|---|
| committer | J08nY | 2022-01-05 01:02:56 +0100 |
| commit | 7a4fed73fa1bf77e9affc8ca2adde9d807adafb0 (patch) | |
| tree | ca765a719cc633590b7719e0b302aa545c0a3539 /tests/test_cc_oop.py | |
| parent | 5c9d861855ab03efa73b550a9a95d598bf4fe2ee (diff) | |
| download | sec-certs-7a4fed73fa1bf77e9affc8ca2adde9d807adafb0.tar.gz sec-certs-7a4fed73fa1bf77e9affc8ca2adde9d807adafb0.tar.zst sec-certs-7a4fed73fa1bf77e9affc8ca2adde9d807adafb0.zip | |
Fix from_dict ordering issue.
Diffstat (limited to 'tests/test_cc_oop.py')
| -rw-r--r-- | tests/test_cc_oop.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_cc_oop.py b/tests/test_cc_oop.py index 2426476d..e4bb4482 100644 --- a/tests/test_cc_oop.py +++ b/tests/test_cc_oop.py @@ -1,4 +1,5 @@ import filecmp +import json import os import shutil import tempfile @@ -157,10 +158,11 @@ class TestCommonCriteriaOOP(TestCase): def test_cert_to_json(self): with NamedTemporaryFile("w") as tmp: self.fictional_cert.to_json(tmp.name) - self.assertTrue( - filecmp.cmp(self.test_data_dir / "fictional_cert.json", tmp.name), - "The sample serialized to json differs from a template.", - ) + with open(tmp.name) as f: + out = json.load(f) + with open(self.test_data_dir / "fictional_cert.json") as f: + template = json.load(f) + assert out == template def test_dataset_to_json(self): with NamedTemporaryFile("w") as tmp: |
