Beispiel #1
0
 def test_get_existing_model_found(self, mock_eng):
     from ramses import models
     mock_eng.get_document_cls.return_value = 1
     model_cls = models.get_existing_model('Foo')
     assert model_cls == 1
     mock_eng.get_document_cls.assert_called_once_with('Foo')
Beispiel #2
0
 def test_get_existing_model_not_found(self, mock_eng):
     from ramses import models
     mock_eng.get_document_cls.side_effect = ValueError
     model_cls = models.get_existing_model('Foo')
     assert model_cls is None
     mock_eng.get_document_cls.assert_called_once_with('Foo')
Beispiel #3
0
 def test_get_existing_model_not_found(self, mock_eng):
     from ramses import models
     mock_eng.get_document_cls.side_effect = ValueError
     model_cls = models.get_existing_model('Foo')
     assert model_cls is None
     mock_eng.get_document_cls.assert_called_once_with('Foo')
Beispiel #4
0
 def test_get_existing_model_found(self, mock_eng):
     from ramses import models
     mock_eng.get_document_cls.return_value = 1
     model_cls = models.get_existing_model('Foo')
     assert model_cls == 1
     mock_eng.get_document_cls.assert_called_once_with('Foo')