예제 #1
0
 def test_from_registry_name_without_attribute(self):
     with pytest.raises(ModelAttributeAdapterException):
         ModelAttributeAdapter("Model.System.Model")
예제 #2
0
 def test_from_declaration(self):
     ma = ModelAttribute('Model.System.Model', 'name')
     maa = ModelAttributeAdapter(ma)
     assert maa is ma
예제 #3
0
 def test_from_registry_name(self):
     maa = ModelAttributeAdapter("Model.System.Model=>name")
     assert isinstance(maa, ModelAttribute)
     assert maa.model_name == 'Model.System.Model'
     assert maa.attribute_name == 'name'
예제 #4
0
 def test_from_registry_name(self):
     maa = ModelAttributeAdapter("Model.System.Model=>name")
     self.assertTrue(isinstance(maa, ModelAttribute))
     self.assertEqual(maa.model_name, 'Model.System.Model')
     self.assertEqual(maa.attribute_name, 'name')