diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-04-09 23:09:38 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-04-09 23:09:38 +0200 |
commit | 9675b386088ff5af7d877f067b77f66e795203a2 (patch) | |
tree | cd5a7b29625125f488c81727c9d7e4c795b9671c /tests | |
parent | 85c5d8ea421805421e78d202c1105da8b7de90c4 (diff) |
Add tests for hardcoded compression types
Git-Dch: Ignore
Diffstat (limited to 'tests')
-rw-r--r-- | tests/05_test_detection.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py index 72c9316..e8ca64b 100644 --- a/tests/05_test_detection.py +++ b/tests/05_test_detection.py @@ -54,7 +54,7 @@ class TestDetection(unittest.TestCase): self.cp, self.tmpdir) - def test_guess_comp_type_bzip2(self): + def test_guess_comp_type_auto_bzip2(self): subject = 'pristine-tar data for source_1.2-3.orig.tar.bz2' repo = MockGitRepository(with_branch=True, subject=subject) guessed = git_buildpackage.guess_comp_type( @@ -68,3 +68,26 @@ class TestDetection(unittest.TestCase): open(os.path.join(self.tmpdir, 'source_1.2.orig.tar.gz'), "w").close() self.assertTrue(has_orig(self.cp, 'gzip', self.tmpdir)) + def test_guess_comp_type_bzip2(self): + repo = MockGitRepository(with_branch=False) + guessed = git_buildpackage.guess_comp_type( + repo, 'bzip2', self.cp, None) + self.assertEqual("bzip2", guessed) + + def test_guess_comp_type_gzip(self): + repo = MockGitRepository(with_branch=False) + guessed = git_buildpackage.guess_comp_type( + repo, 'gzip', self.cp, None) + self.assertEqual("gzip", guessed) + + def test_guess_comp_type_bz(self): + repo = MockGitRepository(with_branch=False) + guessed = git_buildpackage.guess_comp_type( + repo, 'xz', self.cp, None) + self.assertEqual("xz", guessed) + + def test_guess_comp_type_lzma(self): + repo = MockGitRepository(with_branch=False) + guessed = git_buildpackage.guess_comp_type( + repo, 'lzma', self.cp, None) + self.assertEqual("lzma", guessed) |