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>2012-08-10 11:35:11 +0300
commit1f19897482d280f0aa7d3e12a803dac3c73118d1 (patch)
tree6e5f8d192123e0d60020c37b46f5af10e2c63d3d /tests
parent2784e4eff37a66e46936491eef7c7f82cec9eaad (diff)
downloadgit-buildpackage-1f19897482d280f0aa7d3e12a803dac3c73118d1.tar.gz
git-buildpackage-1f19897482d280f0aa7d3e12a803dac3c73118d1.tar.bz2
git-buildpackage-1f19897482d280f0aa7d3e12a803dac3c73118d1.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 861ec131..7cc25fc7 100644
--- a/tests/06_test_upstream_source.py
+++ b/tests/06_test_upstream_source.py
@@ -22,6 +22,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'))
@@ -60,6 +61,7 @@ class TestTar(unittest.TestCase):
"gbp_0.1.tar.bz2")
repacked = source.pack(target)
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"])
@@ -70,6 +72,7 @@ class TestTar(unittest.TestCase):
"gbp_0.1.tar.bz2")
repacked = 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"])
@@ -102,6 +105,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)
source.unpack(self.tmpdir)