diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-08-23 13:39:19 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-11-14 14:22:07 +0200 |
commit | e77eda69e92582a141c430230203123ca6ec4ebc (patch) | |
tree | f7bfdee70b70357b3070578c77124b4a83d3691e /tests | |
parent | a1f2ac982a2a823b33ecdfd8cd2badfa66ef94f1 (diff) | |
download | git-buildpackage-e77eda69e92582a141c430230203123ca6ec4ebc.tar.gz git-buildpackage-e77eda69e92582a141c430230203123ca6ec4ebc.tar.bz2 git-buildpackage-e77eda69e92582a141c430230203123ca6ec4ebc.zip |
UpstreamSource: move version guessing logic to PkgPolicy
PkgPolicy is more logical context, for example if guessing version from
a plain filename and not a real file.
Also, changes guess_version() to always return a tuple to simplify
checking its return value.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/06_test_upstream_source.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/06_test_upstream_source.py b/tests/06_test_upstream_source.py index 2e9246c6..b5989725 100644 --- a/tests/06_test_upstream_source.py +++ b/tests/06_test_upstream_source.py @@ -63,6 +63,8 @@ class TestTar(unittest.TestCase): self.assertEqual(repacked.is_tarball(), True) self.assertEqual(repacked.is_dir(), False) self.assertEqual(repacked.guess_version(), ('gbp', '0.1')) + self.assertEqual(repacked.archive_fmt, 'tar') + self.assertEqual(repacked.compression, 'bzip2') self._check_tar(repacked, ["gbp/errors.py", "gbp/__init__.py"]) def test_pack_filtered(self): @@ -105,6 +107,8 @@ class TestZip(unittest.TestCase): self.assertEqual(source.is_dir(), False) self.assertEqual(source.unpacked, None) self.assertEqual(source.guess_version(), ('gbp', '0.1')) + self.assertEqual(source.archive_fmt, 'zip') + self.assertEqual(source.compression, None) source.unpack(str(self.tmpdir)) self.assertNotEqual(source.unpacked, None) |