aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/02_test_upstream_source_tar_unpack.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-09-09 10:41:19 +0200
committerGuido Günther <agx@sigxcpu.org>2016-09-12 08:52:07 +0200
commitd1c163401153329363a010373cb512f8e59ef1e2 (patch)
tree4360253804301e13b626a47d3ee9b7740dc9fbec /tests/02_test_upstream_source_tar_unpack.py
parentf7db3b77c491e5f76f441a1155aa87b1e5dedde6 (diff)
pep8/pyflakes cleanups
Diffstat (limited to 'tests/02_test_upstream_source_tar_unpack.py')
-rw-r--r--tests/02_test_upstream_source_tar_unpack.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/02_test_upstream_source_tar_unpack.py b/tests/02_test_upstream_source_tar_unpack.py
index 02b50439..e6440903 100644
--- a/tests/02_test_upstream_source_tar_unpack.py
+++ b/tests/02_test_upstream_source_tar_unpack.py
@@ -12,6 +12,7 @@ import six
import gbp.pkg
+
class TestUnpack(unittest.TestCase):
"""Make sure we unpack gzip and bzip2 archives correctly"""
archive_prefix = "archive"
@@ -26,10 +27,10 @@ class TestUnpack(unittest.TestCase):
assert os.path.exists(target), "%s does not exist" % target
def _create_archive(self, comp):
- filelist = [ 'README', 'setup.py' ]
+ filelist = ['README', 'setup.py']
name = "%s_0.1.tar.%s" % (self.archive_prefix, comp)
- t = tarfile.open(name= name, mode='w:%s' % comp)
+ t = tarfile.open(name=name, mode='w:%s' % comp)
for f in filelist:
t.add(os.path.join(self.top, f),
os.path.join(self._unpack_dir(comp), f))
@@ -41,7 +42,7 @@ class TestUnpack(unittest.TestCase):
self.top = context.projectdir
context.chdir(self.dir)
self.archives = {}
- for ext in [ "gz", "bz2" ]:
+ for ext in ["gz", "bz2"]:
self.archives[ext] = self._create_archive(ext)
def tearDown(self):
@@ -50,12 +51,12 @@ class TestUnpack(unittest.TestCase):
def test_upstream_source_type(self):
for (comp, archive) in six.iteritems(self.archives):
source = gbp.pkg.UpstreamSource(archive[0])
- assert source.is_orig() == True
- assert source.is_dir() == False
- assert source.unpacked == None
+ assert source.is_orig() is True
+ assert source.is_dir() is False
+ assert source.unpacked is None
source.unpack(".")
- assert source.is_orig() == True
- assert source.is_dir() == False
+ assert source.is_orig() is True
+ assert source.is_dir() is False
assert type(source.unpacked) == str
def test_upstream_source_unpack(self):