Пример #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')
Пример #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')
Пример #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')
Пример #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')