summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-04-10 16:51:37 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-04-11 13:10:27 +0100
commit48671d75ae47cd133ecf58cc476cd18ea9afd469 (patch)
treee2a59253cd2571fc1ac4d5e37be385ca91f9711b /morphlib/localrepocache_tests.py
parentbb4c7432261aafc8682ffdcb49b76e44e9079501 (diff)
downloadmorph-48671d75ae47cd133ecf58cc476cd18ea9afd469.tar.gz
localrepocache: return error description
Also change _fetch to throw its exception as since it is more pythonic to throw exceptions than return exit status, other error handling needed to be caught, so it hsa been kept consistent. This required the tests to throw an exception as well
Diffstat (limited to 'morphlib/localrepocache_tests.py')
-rw-r--r--morphlib/localrepocache_tests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py
index 72f000f9..49dc021f 100644
--- a/morphlib/localrepocache_tests.py
+++ b/morphlib/localrepocache_tests.py
@@ -15,6 +15,7 @@
import unittest
+import urllib2
import morphlib
@@ -65,7 +66,7 @@ class LocalRepoCacheTests(unittest.TestCase):
self.removed.append(filename)
def not_found(self, url, path):
- return False
+ raise urllib2.URLError('Not found')
def fake_fetch(self, url, path):
self.fetched.append(url)
@@ -135,6 +136,6 @@ class LocalRepoCacheTests(unittest.TestCase):
self.assertFalse('/' in escaped)
def test_noremote_error_message_contains_repo_name(self):
- e = morphlib.localrepocache.NoRemote(self.repourl)
+ e = morphlib.localrepocache.NoRemote(self.repourl, [])
self.assertTrue(self.repourl in str(e))