summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-07-09 17:19:27 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:22:07 +0200
commita1f2ac982a2a823b33ecdfd8cd2badfa66ef94f1 (patch)
treeb3a91fbffd0e4ad686de6c2808f920eb0f2b2a13 /tests
parent69d8238c089cc5ded8b1bf47d54cd36d5fcb42d6 (diff)
downloadgit-buildpackage-a1f2ac982a2a823b33ecdfd8cd2badfa66ef94f1.tar.gz
git-buildpackage-a1f2ac982a2a823b33ecdfd8cd2badfa66ef94f1.tar.bz2
git-buildpackage-a1f2ac982a2a823b33ecdfd8cd2badfa66ef94f1.zip
UpstreamSource: introduce is_tarball() method
New method for checking if the sources are a tarball (possibly for checking if the sources are committable by pristine-tar). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/06_test_upstream_source.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/06_test_upstream_source.py b/tests/06_test_upstream_source.py
index ac210a03..2e9246c6 100644
--- a/tests/06_test_upstream_source.py
+++ b/tests/06_test_upstream_source.py
@@ -24,6 +24,7 @@ class TestDir(unittest.TestCase):
"""Upstream source is a directory"""
source = UpstreamSource(self.upstream_dir)
self.assertEqual(source.is_orig(), False)
+ self.assertEqual(source.is_tarball(), False)
self.assertEqual(source.path, self.upstream_dir)
self.assertEqual(source.unpacked, self.upstream_dir)
self.assertEqual(source.guess_version(), ('test', '1.0'))
@@ -59,6 +60,7 @@ class TestTar(unittest.TestCase):
target = self.tmpdir.join("gbp_0.1.tar.bz2")
repacked = self.source.pack(target)
self.assertEqual(repacked.is_orig(), True)
+ self.assertEqual(repacked.is_tarball(), True)
self.assertEqual(repacked.is_dir(), False)
self.assertEqual(repacked.guess_version(), ('gbp', '0.1'))
self._check_tar(repacked, ["gbp/errors.py", "gbp/__init__.py"])
@@ -68,6 +70,7 @@ class TestTar(unittest.TestCase):
target = self.tmpdir.join("gbp_0.1.tar.bz2")
repacked = self.source.pack(target, ["__init__.py"])
self.assertEqual(repacked.is_orig(), True)
+ self.assertEqual(repacked.is_tarball(), True)
self.assertEqual(repacked.is_dir(), False)
self._check_tar(repacked, ["gbp/errors.py"],
["gbp/__init__.py"])
@@ -98,6 +101,7 @@ class TestZip(unittest.TestCase):
def test_unpack(self):
source = UpstreamSource(self.zipfile)
self.assertEqual(source.is_orig(), False)
+ self.assertEqual(source.is_tarball(), False)
self.assertEqual(source.is_dir(), False)
self.assertEqual(source.unpacked, None)
self.assertEqual(source.guess_version(), ('gbp', '0.1'))