diff options
| author | Adam Janovsky | 2022-01-29 10:56:35 +0100 |
|---|---|---|
| committer | Adam Janovsky | 2022-01-29 10:56:35 +0100 |
| commit | bb2bfcd5dfd2a6ed5d136d8dc03d7a8aa48a7b34 (patch) | |
| tree | e13d573b8bc8553365321fc59185d2599872a975 /tests/test_cc_oop.py | |
| parent | 1267e35e85843953aceadda2ab206979757f14e2 (diff) | |
| parent | fdeaa61d1e62f1d23adc001b57c32d11df07fc4a (diff) | |
| download | sec-certs-bb2bfcd5dfd2a6ed5d136d8dc03d7a8aa48a7b34.tar.gz sec-certs-bb2bfcd5dfd2a6ed5d136d8dc03d7a8aa48a7b34.tar.zst sec-certs-bb2bfcd5dfd2a6ed5d136d8dc03d7a8aa48a7b34.zip | |
Merge branch 'dev' into dependency-analysis
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..c2a9223b 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) + self.assertEqual(out, template, "Serialized cert differs from cert json template.") def test_dataset_to_json(self): with NamedTemporaryFile("w") as tmp: |
