diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-05-27 10:07:49 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-05-27 10:07:49 +0200 |
commit | 22435b270da1676412b10d4f233f945c5b120b2e (patch) | |
tree | 10106c9138f30a82e0aa2df2ce2eeffffdfd0db0 /tests/05_test_detection.py | |
parent | e71b3e867d405e1efd254a28575e7f97eb8701b7 (diff) |
buildpackage: Check for existence of subtarballs as well
Diffstat (limited to 'tests/05_test_detection.py')
-rw-r--r-- | tests/05_test_detection.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py index 126a2992..9b902e10 100644 --- a/tests/05_test_detection.py +++ b/tests/05_test_detection.py @@ -67,12 +67,24 @@ class TestDetection(unittest.TestCase): repo, 'auto', self.cp, str(self.tmpdir)) self.assertEqual("bzip2", guessed) - def test_has_orig_false(self): - self.assertFalse(DebianPkgPolicy.has_orig(orig_file(self.cp, 'gzip'), str(self.tmpdir))) + def test_has_orig_single_false(self): + self.assertFalse(DebianPkgPolicy.has_origs([orig_file(self.cp, 'gzip')], str(self.tmpdir))) - def test_has_orig_true(self): + def test_has_orig_single_true(self): open(self.tmpdir.join('source_1.2.orig.tar.gz'), "w").close() - self.assertTrue(DebianPkgPolicy.has_orig(orig_file(self.cp, 'gzip'), str(self.tmpdir))) + self.assertTrue(DebianPkgPolicy.has_origs([orig_file(self.cp, 'gzip')], str(self.tmpdir))) + + def test_has_orig_multiple_false(self): + orig_files = [orig_file(self.cp, 'gzip')] + \ + [orig_file(self.cp, 'gzip', sub) for sub in ['foo', 'bar']] + self.assertFalse(DebianPkgPolicy.has_origs(orig_files, str(self.tmpdir))) + + def test_has_orig_multiple_true(self): + for ext in ['', '-foo', '-bar']: + open(self.tmpdir.join('source_1.2.orig%s.tar.gz' % ext), "w").close() + orig_files = [orig_file(self.cp, 'gzip')] + \ + [orig_file(self.cp, 'gzip', sub) for sub in ['foo', 'bar']] + self.assertTrue(DebianPkgPolicy.has_origs(orig_files, str(self.tmpdir))) def test_guess_comp_type_bzip2(self): repo = MockGitRepository(with_branch=False) |