summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-01-13 16:56:34 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-01-13 16:56:34 +0000
commit8d0448d044f20a148f98700a691a83c95308a8e8 (patch)
treef6cc78d83f1a7b5c330b8a54732c2ee84191f34a
parent9e464b41e3255c95b6d72b8eb5f682c44171a536 (diff)
downloadimport-baserock/richardipsum/fix-lorry-bug-3.tar.gz
Update tests for python.to_lorrybaserock/richardipsum/fix-lorry-bug-3
-rwxr-xr-xbaserockimport/exts/python_lorry_tests.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/baserockimport/exts/python_lorry_tests.py b/baserockimport/exts/python_lorry_tests.py
index 12ef564..be4bcac 100755
--- a/baserockimport/exts/python_lorry_tests.py
+++ b/baserockimport/exts/python_lorry_tests.py
@@ -21,6 +21,8 @@ import json
import unittest
+LORRY_PREFIX = 'python'
+
class Tests(unittest.TestCase):
def test_make_tarball_lorry(self):
@@ -35,18 +37,19 @@ class Tests(unittest.TestCase):
return 'http://foobar/baz.%s' % extension
def get_tarball_lorry_url(name, lorry_json):
- return json.loads(lorry_json)['python-packages/'
+ return json.loads(lorry_json)[LORRY_PREFIX + '/'
+ name + '-tarball']['url']
def get_tarball_lorry_compression(name, lorry_json):
- return json.loads(lorry_json)['python-packages/'
+ return json.loads(lorry_json)[LORRY_PREFIX + '/'
+ name + '-tarball']['compression']
fake_package_name = 'name'
urls = [(make_url(ext), ext) for ext in valid_extensions]
for (url, ext) in urls:
- lorry_json = python_lorry.make_tarball_lorry('name', url)
+ lorry_json = python_lorry.make_tarball_lorry(LORRY_PREFIX,
+ 'name', url)
print lorry_json
tarball_url = get_tarball_lorry_url(fake_package_name, lorry_json)
@@ -61,7 +64,7 @@ class Tests(unittest.TestCase):
self.assertEqual(tarball_compression, valid_extensions[ext])
url = 'http://foobar/baz.tar'
- lorry_json = python_lorry.make_tarball_lorry('name', url)
+ lorry_json = python_lorry.make_tarball_lorry(LORRY_PREFIX, 'name', url)
self.assertEqual(get_tarball_lorry_url(fake_package_name,
lorry_json), url)
self.assertTrue('compression' not in lorry_json)