コード例 #1
0
ファイル: test_models.py プロジェクト: alainlompo/ramses
 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
ファイル: test_models.py プロジェクト: thanhliem89dn/ramses
 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
ファイル: test_models.py プロジェクト: alainlompo/ramses
 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
ファイル: test_models.py プロジェクト: thanhliem89dn/ramses
 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')