summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-07-18 16:15:47 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-07-18 16:17:39 +0100
commitd400ccc735a6282680529f321614062fcef50f23 (patch)
tree4239e60b9762777d55092d2edf4fb76ee4ccf676 /morphlib/morphologyfactory_tests.py
parent82162907439d79afa5a8063d66426288ccfb21dc (diff)
downloadmorph-d400ccc735a6282680529f321614062fcef50f23.tar.gz
Add missing empty lines, for clarity
Diffstat (limited to 'morphlib/morphologyfactory_tests.py')
-rw-r--r--morphlib/morphologyfactory_tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/morphlib/morphologyfactory_tests.py b/morphlib/morphologyfactory_tests.py
index 0cd9e4b1..11d53a19 100644
--- a/morphlib/morphologyfactory_tests.py
+++ b/morphlib/morphologyfactory_tests.py
@@ -22,7 +22,9 @@ from morphlib.morphologyfactory import (MorphologyFactory,
NotcachedError)
from morphlib.remoterepocache import CatFileError
+
class FakeRemoteRepoCache(object):
+
def cat_file(self, reponame, sha1, filename):
if filename.endswith('.morph'):
return '''{
@@ -32,7 +34,9 @@ class FakeRemoteRepoCache(object):
}'''
return 'text'
+
class FakeLocalRepo(object):
+
def cat(self, sha1, filename):
if filename.endswith('.morph'):
return '''{
@@ -42,15 +46,21 @@ class FakeLocalRepo(object):
}'''
return 'text'
+
class FakeLocalRepoCache(object):
+
def __init__(self, lr):
self.lr = lr
+
def has_repo(self, reponame):
return True
+
def get_repo(self, reponame):
return self.lr
+
class MorphologyFactoryTests(unittest.TestCase):
+
def setUp(self):
self.lr = FakeLocalRepo()
self.lrc = FakeLocalRepoCache(self.lr)
@@ -60,12 +70,15 @@ class MorphologyFactoryTests(unittest.TestCase):
def nolocalfile(self, *args):
raise IOError('File not found')
+
def noremotefile(self, *args):
raise CatFileError('reponame', 'ref', 'filename')
+
def nolocalmorph(self, *args):
if args[-1].endswith('.morph'):
raise IOError('File not found')
return 'text'
+
def noremotemorph(self, *args):
if args[-1].endswith('.morph'):
raise CatFileError('reponame', 'ref', 'filename')