summaryrefslogtreecommitdiff
path: root/morphlib/remoterepocache_tests.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-08-26 12:53:33 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-08-26 12:53:33 +0000
commit8c9aea626d1308a876d145d379ac5f23905fa9b4 (patch)
treeff15a510e42ca90d42d9c3f07897024262df4fe8 /morphlib/remoterepocache_tests.py
parent32936bd5fa1d27260faa8074a80b64287fec90c7 (diff)
parente86a598553e96dab2dc4111aedefcb6b0a60c50d (diff)
downloadmorph-8c9aea626d1308a876d145d379ac5f23905fa9b4.tar.gz
Merge remote-tracking branch 'origin/baserock/richardmaw/bugfix/http-fail'
Reviewed-by: Francisco Redondo Marchena Reviewed-by: Sam Thursfield
Diffstat (limited to 'morphlib/remoterepocache_tests.py')
-rw-r--r--morphlib/remoterepocache_tests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/morphlib/remoterepocache_tests.py b/morphlib/remoterepocache_tests.py
index 0b1a183b..ef81506f 100644
--- a/morphlib/remoterepocache_tests.py
+++ b/morphlib/remoterepocache_tests.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
import json
import unittest
+import urllib2
import morphlib
@@ -26,7 +27,11 @@ class RemoteRepoCacheTests(unittest.TestCase):
return self.sha1s[repo_url][ref]
def _cat_file_for_repo_url(self, repo_url, sha1, filename):
- return self.files[repo_url][sha1][filename]
+ try:
+ return self.files[repo_url][sha1][filename]
+ except KeyError:
+ raise urllib2.HTTPError(url='', code=404, msg='Not found',
+ hdrs={}, fp=None)
def _ls_tree_for_repo_url(self, repo_url, sha1):
return json.dumps({