From c0f1d8463ca4b7b998952959973295acdf2b60f5 Mon Sep 17 00:00:00 2001 From: Tom Mitchell Date: Fri, 11 Feb 2022 11:59:40 -0500 Subject: [PATCH] Test automatic list wrapping for Measure --- test/test_om_unit.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_om_unit.py b/test/test_om_unit.py index 1f3b2a8..3936706 100644 --- a/test/test_om_unit.py +++ b/test/test_om_unit.py @@ -47,6 +47,17 @@ def test_read_from_file(self): measure.unit) self.assertEqual('measure1', measure.display_id) + def test_list_wrapping(self): + # Ensure that at least certain properties handle automatic list + # wrapping and are typed to do so. + # See https://github.com/SynBioDex/pySBOL3/issues/301 + sbol3.set_namespace('https://github.com/synbiodex/pysbol3') + unit_uri = 'http://www.ontology-of-units-of-measure.org/resource/om-2/gramPerLitre' + # SBO:0000612 is from the SBOL 3.0.1 specification. + test_type = 'https://identifiers.org/SBO:0000612' + measure1 = sbol3.Measure(value=1.0, unit=unit_uri, types=test_type) + self.assertEqual([test_type], measure1.types) + class TestPrefixedUnit(unittest.TestCase):