From 7a4fed73fa1bf77e9affc8ca2adde9d807adafb0 Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 5 Jan 2022 01:02:56 +0100 Subject: Fix from_dict ordering issue. --- tests/test_cc_oop.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/test_cc_oop.py') 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: -- cgit v1.3.1