예제 #1
0
 def test_is_hashable(self):
     obj = sbol2.SBOLObject()
     self.assertTrue(isinstance(obj, collections.abc.Hashable))
     # Make sure the hash function returns a reasonable value. The
     # hashable test above can be fooled according to the
     # documentation.
     self.assertTrue(isinstance(hash(obj), int))
예제 #2
0
 def test_init_store(self):
     # Ensure that property constructors initialize the parent
     # object's value store
     obj = sbol2.SBOLObject()
     type_uri = 'http://example.com#thing'
     obj.thing = sbol2.OwnedObject(obj, type_uri, int, '0', '*')
     self.assertIn(type_uri, obj.owned_objects)
     self.assertEqual([], obj.owned_objects[type_uri])
     self.assertEqual([], obj.thing.value)
예제 #3
0
 def test_init_store(self):
     # Ensure that property constructors initialize the parent
     # object's value store
     obj = sbol2.SBOLObject()
     type_uri = 'http://example.com#thing'
     obj.thing = sbol2.URIProperty(obj, type_uri, '0', '*', [])
     self.assertIn(type_uri, obj.properties)
     self.assertEqual([], obj.properties[type_uri])
     self.assertEqual([], obj.thing)