Skip to content

Commit

Permalink
better mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed May 18, 2015
1 parent dd80e87 commit d87f3df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elasticgit/tests/test_remote_storage.py
Expand Up @@ -32,13 +32,17 @@ def test_storage_exists(self):
response.status_code = 200
mock.return_value = response
self.assertTrue(self.rsm.storage_exists())
mock.assert_called_with(
'GET', 'http://www.example.org/repos/foo.json')

def test_storage_doesnot_exist(self):
with patch.object(self.rsm, 'mk_request') as mock:
response = Response()
response.status_code = 404
mock.return_value = response
self.assertFalse(self.rsm.storage_exists())
mock.assert_called_with(
'GET', 'http://www.example.org/repos/foo.json')

def test_write_config(self):
self.assertRaises(
Expand Down

0 comments on commit d87f3df

Please sign in to comment.