From 9675b386088ff5af7d877f067b77f66e795203a2 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 9 Apr 2011 23:09:38 +0200 Subject: Add tests for hardcoded compression types Git-Dch: Ignore --- tests/05_test_detection.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit v1.2.3