Skip to content

Commit

Permalink
Add a string test
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jan 8, 2024
1 parent eda0e17 commit 69ee4c7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/schema/test_hed_schema_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def test_schema2xml(self, filename):
self.assertEqual(loaded_schema, self.base_schema)

@with_temp_file(".ttl")
def test_schema2wiki(self, filename):
def test_schema2turtle(self, filename):
self.base_schema.save_as_owl(filename)
loaded_schema = schema.load_schema(filename)

Expand All @@ -612,6 +612,17 @@ def test_schema2jsonld(self, filename):

self.assertEqual(loaded_schema, self.base_schema)

def test_schema2owlstring(self):
owl_string = self.base_schema.get_as_owl_string(file_format="turtle")
loaded_schema = schema.from_string(owl_string, schema_format="turtle")

self.assertEqual(loaded_schema, self.base_schema)

owl_string = self.base_schema.get_as_owl_string(save_merged=True, file_format="turtle")
loaded_schema = schema.from_string(owl_string, schema_format="turtle")

self.assertEqual(loaded_schema, self.base_schema)

def test_schema2bad_filename(self):
with self.assertRaises(OSError):
self.base_schema.save_as_owl("", file_format="xml")
Expand Down

0 comments on commit 69ee4c7

Please sign in to comment.