Exemplo n.º 1
0
 def test_handle_model_generation(self, mock_set):
     mock_set.return_value = ('Foo1', True)
     model, auth_model = generators.handle_model_generation(
         'foo', '/stories')
     mock_set.assert_called_once_with('foo', 'Story')
     assert model == 'Foo1'
     assert auth_model
Exemplo n.º 2
0
 def test_handle_model_generation_value_err(self, mock_set):
     mock_set.side_effect = ValueError('strange error')
     with pytest.raises(ValueError) as ex:
         generators.handle_model_generation('foo', '/stories')
     assert str(ex.value) == 'Story: strange error'
     mock_set.assert_called_once_with('foo', 'Story')