Skip to content
Snippets Groups Projects
Commit 84ca234e authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#39 Endring i test-kommentarer

parent b12cc8f8
No related branches found
No related tags found
1 merge request!40#38 #39 Eksporter og importer SOI til/fra fil
Pipeline #77403 passed
......@@ -94,7 +94,7 @@ class SerializeTest(unittest.TestCase):
self.assertTrue(SERIALIZED_SOI_SCHEMA.is_valid(json_data))
def test_import_soi(self):
"""Import serialized SOI, check SOI content and delete SOI-file."""
"""Import serialized SOI, check SOI content and delete SOI-files."""
# Write invalid serialization to file
invalid_soi_file_path = "test_file.json"
invalid_serialization = {
......@@ -105,13 +105,14 @@ class SerializeTest(unittest.TestCase):
file.write(str(invalid_serialization))
file.close()
# Assert invalid serialization throws error on import
with self.assertRaises(ValueError) as err:
with self.assertRaises(ValueError) as error:
import_soi(invalid_soi_file_path)
self.assertEqual(
str(err.exception), "Serialized SOI does not have correct format."
str(error.exception),
"Serialized SOI does not have correct format.",
)
# Import SOI
# Import SOI with correct format
soi = import_soi(self.file_path)
# Assert SOI content is correct
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment