summaryrefslogtreecommitdiff
path: root/morphlib/cachedrepo_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-05-29 17:18:46 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-05-30 13:11:13 +0100
commitb088e31b740c62b90ddf9c3342b876736790c1e8 (patch)
treeb73ea9c49d130c584c50c3b8c55f755f5cfa6d4a /morphlib/cachedrepo_tests.py
parent34817d54a193c6c0937ef3868f31d822e90aa740 (diff)
downloadmorph-b088e31b740c62b90ddf9c3342b876736790c1e8.tar.gz
morph: remove dead code and replace Execute with app.runcmd
Diffstat (limited to 'morphlib/cachedrepo_tests.py')
-rw-r--r--morphlib/cachedrepo_tests.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/morphlib/cachedrepo_tests.py b/morphlib/cachedrepo_tests.py
index f3d4d1fc..0baeba26 100644
--- a/morphlib/cachedrepo_tests.py
+++ b/morphlib/cachedrepo_tests.py
@@ -17,6 +17,8 @@
import os
import unittest
+import cliapp
+
import morphlib
from morphlib import cachedrepo
@@ -36,7 +38,7 @@ class CachedRepoTests(unittest.TestCase):
try:
return output[ref]
except:
- raise morphlib.execute.CommandFailure('git show-ref %s' % ref, '')
+ raise cliapp.AppException('git show-ref %s' % ref, '')
def rev_list(self, ref):
output = {
@@ -48,7 +50,7 @@ class CachedRepoTests(unittest.TestCase):
try:
return output[ref]
except:
- raise morphlib.execute.CommandFailure('git rev-list %s' % ref, '')
+ raise cliapp.AppException('git rev-list %s' % ref, '')
def cat_file(self, ref, filename):
output = {
@@ -58,7 +60,7 @@ class CachedRepoTests(unittest.TestCase):
try:
return output['%s:%s' % (ref, filename)]
except:
- raise morphlib.execute.CommandFailure(
+ raise cliapp.AppException(
'git cat-file blob %s:%s' % (ref, filename), '')
def copy_repository(self, source_dir, target_dir):
@@ -72,7 +74,7 @@ class CachedRepoTests(unittest.TestCase):
if ref in bad_refs:
# simulate a git failure or something similar to
# trigger a CheckoutError
- raise morphlib.execute.CommandFailure('git checkout %s' % ref, '')
+ raise cliapp.AppException('git checkout %s' % ref, '')
else:
with open(os.path.join(target_dir, 'foo.morph'), 'w') as f:
f.write('contents of foo.morph')
@@ -81,13 +83,13 @@ class CachedRepoTests(unittest.TestCase):
pass
def update_with_failure(self):
- raise morphlib.execute.CommandFailure('git remote update origin', '')
+ raise cliapp.AppException('git remote update origin', '')
def setUp(self):
self.repo_name = 'foo'
self.repo_url = 'git://foo.bar/foo.git'
self.repo_path = '/tmp/foo'
- self.repo = cachedrepo.CachedRepo(
+ self.repo = cachedrepo.CachedRepo(object(),
self.repo_name, self.repo_url, self.repo_path)
self.repo._show_ref = self.show_ref
self.repo._rev_list = self.rev_list