Skip to content

Commit

Permalink
more tests for stuff that should not be implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed May 19, 2015
1 parent 16ca15b commit 43ac31b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions elasticgit/remote_storage.py
Expand Up @@ -27,6 +27,9 @@ def __init__(self, repo_url):
self.repo_name, _, self.suffix = basename.partition('.')

def mk_request(self, *args, **kwargs):
"""
Mocked out in tests
"""
return requests.request(*args, **kwargs)

def url(self, *parts):
Expand Down
20 changes: 20 additions & 0 deletions elasticgit/tests/test_remote_storage.py
Expand Up @@ -58,6 +58,26 @@ def test_destroy_storage(self):
self.assertRaises(
RemoteStorageException, self.rsm.destroy_storage)

def test_store(self):
self.assertRaises(
RemoteStorageException, self.rsm.store, TestPerson({}),
'commit message')

def test_store_data(self):
self.assertRaises(
RemoteStorageException, self.rsm.store_data, 'foo/bar',
'data', 'commit message')

def test_delete(self):
self.assertRaises(
RemoteStorageException, self.rsm.delete, TestPerson({}),
'commit message')

def test_delete_data(self):
self.assertRaises(
RemoteStorageException, self.rsm.delete_data, 'foo/bar',
'commit message')

def test_iterate(self):
with patch.object(self.rsm, 'mk_request') as mock:
response = Response()
Expand Down

0 comments on commit 43ac31b

Please sign in to comment.