Commit a06fc0eb authored by Florian Pritz's avatar Florian Pritz
Browse files

Ensure reproducible upload order for tests


Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
parent 182e842a
......@@ -31,10 +31,10 @@ class TestUploader(unittest.TestCase):
app.main('./test-data/archive/packages/f/fb-client')
mock_uploader.upload.assert_called_once_with('archlinux_pkg_fb-client',
files=['./test-data/archive/packages/f/fb-client/fb-client-2.0.4-1-any.pkg.tar.xz',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.3-2-any.pkg.tar.xz',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.4-1-any.pkg.tar.xz.sig',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.3-2-any.pkg.tar.xz.sig'],
files=['./test-data/archive/packages/f/fb-client/fb-client-2.0.3-2-any.pkg.tar.xz',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.3-2-any.pkg.tar.xz.sig',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.4-1-any.pkg.tar.xz',
'./test-data/archive/packages/f/fb-client/fb-client-2.0.4-1-any.pkg.tar.xz.sig',],
metadata=mock.ANY)
......
......@@ -58,6 +58,8 @@ class ArchiveUploader:
files.append(f.path)
if not files:
return
# ensure reproducible order for tests
files.sort()
# Get last package, to extract a description
last_pkg = sorted(filter(lambda x: not x.endswith('.sig'), files))[-1]
pkginfo = self.extract_pkginfo(last_pkg)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment