summaryrefslogtreecommitdiff
path: root/morphlib/sourcemanager_tests.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-24 13:39:18 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-24 13:39:18 +0000
commit3598043989d215cf2c02d50cfec33046eb0e2358 (patch)
tree52d535fa470925c6927a33c5a6405a28938beeea /morphlib/sourcemanager_tests.py
parente543fc5760dde600c9699955214e7392954f0778 (diff)
downloadmorph-3598043989d215cf2c02d50cfec33046eb0e2358.tar.gz
Rework the bundle code to set the bundle filename outside _wget().
This is a bit stupid and requires tests to be adjusted (which is done in this commit as well).
Diffstat (limited to 'morphlib/sourcemanager_tests.py')
-rw-r--r--morphlib/sourcemanager_tests.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/morphlib/sourcemanager_tests.py b/morphlib/sourcemanager_tests.py
index 75bac956..7dc77b11 100644
--- a/morphlib/sourcemanager_tests.py
+++ b/morphlib/sourcemanager_tests.py
@@ -14,6 +14,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import glob
import unittest
import tempfile
import shutil
@@ -127,10 +128,10 @@ class SourceManagerTests(unittest.TestCase):
s = morphlib.sourcemanager.SourceManager(app, tempdir)
- def wget(url):
- path=urlparse.urlparse(url).path
- shutil.copy(path, s.cache_dir)
- return self.temprepo
+ def wget(url, filename):
+ bundle_file = os.path.join(self.temprepodir,
+ os.path.basename(filename))
+ shutil.copy(bundle_file, s.cache_dir)
s._wget = wget
@@ -146,10 +147,8 @@ class SourceManagerTests(unittest.TestCase):
s = morphlib.sourcemanager.SourceManager(app, tempdir)
- def wget(url):
- path=urlparse.urlparse(url).path
- shutil.copy(path, s.cache_dir)
- return self.temprepo
+ def wget(url, filename):
+ shutil.copy(filename, s.cache_dir)
s._wget = wget
self.assertRaises(morphlib.sourcemanager.RepositoryFetchError,
@@ -165,10 +164,8 @@ class SourceManagerTests(unittest.TestCase):
s = morphlib.sourcemanager.SourceManager(app, tempdir)
- def wget(url):
- path=urlparse.urlparse(url).path
- shutil.copy(path, s.cache_dir)
- return self.temprepo
+ def wget(url, filename):
+ shutil.copy(filename, s.cache_dir)
s._wget = wget
self.assertRaises(morphlib.sourcemanager.RepositoryFetchError,