Example #1
0
 def test_register_without_typename(self):
     class TestProperty():
         pass
     PropertyType.register(TestProperty, 'TestProperty')
     self.assertIs(PropertyType('TestProperty'), TestProperty)
Example #2
0
 def test_deregister(self):
     class TestProperty(Property):
         typename = 'TestProperty'
     PropertyType.deregister(TestProperty)
     with self.assertRaises(TypeError):
         PropertyType('TestProperty')
Example #3
0
 def test_register_with_typename(self):
     class TestProperty():
         typename = 'TestProperty'
     PropertyType.register(TestProperty)
     self.assertIs(PropertyType('TestProperty'), TestProperty)