aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/05_test_detection.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-02-13 08:11:09 +0100
committerGuido Günther <agx@sigxcpu.org>2017-02-13 20:08:22 +0100
commitec9f9135f5c31a3f52d342e2faac2b44647709dc (patch)
treee5cb43303868cb7e89a1dd4466444192d5b3f244 /tests/05_test_detection.py
parent98e736dda22a5aa2b4bd9007d40dcf3927207533 (diff)
Pass source pkg around instead of changelog
This gives us more control since we have the full source package information and increases readability. Git-Dch: Ignore
Diffstat (limited to 'tests/05_test_detection.py')
-rw-r--r--tests/05_test_detection.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/05_test_detection.py b/tests/05_test_detection.py
index 2355f1f9..ba524fc9 100644
--- a/tests/05_test_detection.py
+++ b/tests/05_test_detection.py
@@ -30,9 +30,14 @@ class MockGitRepository:
class TestDetection(unittest.TestCase):
+ class source(object):
+ name = 'source'
+ upstream_version = '1.2'
+ changelog = {'Source': 'source', 'Upstream-Version': '1.2'}
+
def setUp(self):
self.tmpdir = context.new_tmpdir(__name__)
- self.cp = {'Source': 'source', 'Upstream-Version': '1.2'}
+ self.cp = self.source.changelog
def tearDown(self):
context.teardown()
@@ -40,14 +45,14 @@ class TestDetection(unittest.TestCase):
def test_guess_comp_type_no_pristine_tar_no_orig(self):
repo = MockGitRepository(with_branch=False)
guessed = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ repo, 'auto', self.source, str(self.tmpdir))
self.assertEqual('gzip', guessed)
def test_guess_comp_type_no_pristine_tar_with_orig(self):
open(self.tmpdir.join('source_1.2.orig.tar.bz2'), "w").close()
repo = MockGitRepository(with_branch=False)
guessed = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ repo, 'auto', self.source, str(self.tmpdir))
self.assertEqual('bzip2', guessed)
def test_guess_comp_type_no_pristine_tar_with_multiple_origs(self):
@@ -59,14 +64,14 @@ class TestDetection(unittest.TestCase):
buildpackage.guess_comp_type,
repo,
'auto',
- self.cp,
+ self.source,
str(self.tmpdir))
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 = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ repo, 'auto', self.source, str(self.tmpdir))
self.assertEqual("bzip2", guessed)
def test_has_orig_single_false(self):