def test_from_registry_name_without_attribute(self): with pytest.raises(ModelAttributeAdapterException): ModelAttributeAdapter("Model.System.Model")
def test_from_declaration(self): ma = ModelAttribute('Model.System.Model', 'name') maa = ModelAttributeAdapter(ma) assert maa is ma
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'
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')