summaryrefslogtreecommitdiff
path: root/baserockimport/exts/python_lorry_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'baserockimport/exts/python_lorry_tests.py')
-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)