summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLoïc Minier <lool@debian.org>2011-04-08 03:38:12 +0200
committerGuido Günther <agx@sigxcpu.org>2011-04-09 22:42:24 +0200
commitabf76d0ad980f405f458d54051d0f75a847d25a7 (patch)
treeb6bdee84f8b74e216a2d929f7cf23091c6469a15 /tests
parent8189cc9e01ed42f67b20d59a9f18247779a86ed4 (diff)
downloadgit-buildpackage-abf76d0ad980f405f458d54051d0f75a847d25a7.tar.gz
git-buildpackage-abf76d0ad980f405f458d54051d0f75a847d25a7.tar.bz2
git-buildpackage-abf76d0ad980f405f458d54051d0f75a847d25a7.zip
Update guess_comp_type to take a cp as param
Git-Dch: Ignore
Diffstat (limited to 'tests')
-rw-r--r--tests/05_test_detection.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py
index 1454e4da..9c7abfcd 100644
--- a/tests/05_test_detection.py
+++ b/tests/05_test_detection.py
@@ -23,28 +23,26 @@ class MockGitRepository:
class TestDetection(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
+ self.cp = {'Source': 'source', 'Upstream-Version': '1.2'}
def tearDown(self):
shutil.rmtree(self.tmpdir)
def test_guess_comp_type_no_pristine_tar(self):
repo = MockGitRepository(with_branch=False)
- guessed = git_buildpackage.guess_comp_type(repo, 'auto', None, None)
+ guessed = git_buildpackage.guess_comp_type(repo, 'auto', self.cp)
self.assertEqual('gzip', guessed)
def test_guess_comp_type_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(
- repo, 'auto', 'source', '1.2')
+ guessed = git_buildpackage.guess_comp_type(repo, 'auto', self.cp)
self.assertEqual("bzip2", guessed)
def test_has_orig_false(self):
- cp = {'Source': 'source', 'Upstream-Version': '1.2'}
- self.assertFalse(has_orig(cp, 'gzip', self.tmpdir))
+ self.assertFalse(has_orig(self.cp, 'gzip', self.tmpdir))
def test_has_orig_true(self):
- cp = {'Source': 'source', 'Upstream-Version': '1.2'}
open(os.path.join(self.tmpdir, 'source_1.2.orig.tar.gz'), "w").close()
- self.assertTrue(has_orig(cp, 'gzip', self.tmpdir))
+ self.assertTrue(has_orig(self.cp, 'gzip', self.tmpdir))