Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-03-05 19:33:40 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2018-03-05 19:58:00 +0300
commitabb1c0d1b0e9c1e7d2e53bb32cf17848c232c523 (patch)
tree19485564a052ae341d0ff014bb3e1103b8a1b8e4
parent37099fb8b4007e7d10a6eded2bb2e849500f9b3f (diff)
Make test_scan_uploads repeatable
setup.hint files get renamed at upload since 828b91be, so use a copy of testdata/homes to make the test repeatable.
-rwxr-xr-xtest/test_calm.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_calm.py b/test/test_calm.py
index 35f0e24..f514b7d 100755
--- a/test/test_calm.py
+++ b/test/test_calm.py
@@ -290,11 +290,18 @@ class CalmTest(unittest.TestCase):
def test_scan_uploads(self):
self.maxDiff = None
+ test_root = tempfile.mktemp()
+ logging.info('test_root = %s', test_root)
+
args = types.SimpleNamespace()
setattr(args, 'arch', 'x86')
setattr(args, 'rel_area', 'testdata/relarea')
setattr(args, 'dryrun', False)
+ shutil.copytree('testdata/homes', os.path.join(test_root, 'testdata/homes'))
+ oldcwd = os.getcwd()
+ os.chdir(test_root)
+
pkglist = ['after-ready', 'not-ready', 'testpackage', 'testpackage2']
mlist = {}
@@ -311,6 +318,9 @@ class CalmTest(unittest.TestCase):
scan_result = uploads.scan(m, pkglist + ['not-on-maintainer-list'], args.arch, args)
+ os.chdir(oldcwd)
+ shutil.rmtree(test_root)
+
self.assertEqual(scan_result.error, False)
compare_with_expected_file(self, 'testdata/uploads', dict(scan_result.to_relarea), 'move')
self.assertCountEqual(scan_result.to_vault, {'x86/release/testpackage': ['x86/release/testpackage/testpackage-0.1-1.tar.bz2']})