summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2019-11-14 16:17:06 +0800
committerbiao716.wang <biao716.wang@samsung.com>2019-11-14 16:17:06 +0800
commit4696eb2a81eeb2af32cbdda8b0e612b3726ac1f7 (patch)
tree345a223e0387d52050c26f6d7bb52095953b31a7 /tests
parentf0a26b109d267557c949c5fe1012936a3f4d85a7 (diff)
downloadgit-buildpackage-4696eb2a81eeb2af32cbdda8b0e612b3726ac1f7.tar.gz
git-buildpackage-4696eb2a81eeb2af32cbdda8b0e612b3726ac1f7.tar.bz2
git-buildpackage-4696eb2a81eeb2af32cbdda8b0e612b3726ac1f7.zip
fix pylint error for git-buildpackage
Change-Id: Ia319032dcd3f55600bb79b5c85372a7a77122174 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/04_test_submodules.py12
-rw-r--r--tests/context.py1
-rw-r--r--tests/test_rpm_changelog.py10
3 files changed, 12 insertions, 11 deletions
diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py
index 1b45c86f..7f4c6996 100644
--- a/tests/04_test_submodules.py
+++ b/tests/04_test_submodules.py
@@ -38,7 +38,7 @@ def setup():
TMPDIR = context.new_tmpdir(__name__)
REPODIR = TMPDIR.join('test_repo')
REPO = gbp.git.GitRepository.create(REPODIR)
-
+ SUBMODULES = []
for name in SUBMODULE_NAMES:
SUBMODULES.append(Submodule(name, str(TMPDIR)))
@@ -134,11 +134,11 @@ def test_add_whitespace_submodule():
def test_get_more_submodules():
"""Check for submodules list of (name, hash)"""
- module = REPO.get_submodules("master")
- eq_(len(module), len(SUBMODULE_NAMES))
- for module in REPO.get_submodules("master"):
- eq_(len(module[1]) , 40)
- ok_(os.path.basename(module[0]) in SUBMODULE_NAMES)
+ modules = REPO.get_submodules("master")
+ eq_(len(modules), len(SUBMODULE_NAMES))
+ module = REPO.get_submodules("master")[0]
+ eq_(len(module[1]) , 40)
+ ok_(os.path.basename(module[0]) in SUBMODULE_NAMES)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
diff --git a/tests/context.py b/tests/context.py
index cc3e25df..9800d85d 100644
--- a/tests/context.py
+++ b/tests/context.py
@@ -28,6 +28,7 @@ def chdir(dir):
def new_tmpdir(name):
global _tmpdirs
+ _tmpdirs = []
prefix='gbp_%s_' % name
tmpdir = TmpDir(prefix)
_tmpdirs.append(tmpdir)
diff --git a/tests/test_rpm_changelog.py b/tests/test_rpm_changelog.py
index 22739f0e..953919ec 100644
--- a/tests/test_rpm_changelog.py
+++ b/tests/test_rpm_changelog.py
@@ -31,14 +31,14 @@ class TestChangelogHeader(object):
def test_str_format(self):
"""Basic test for header"""
- time = datetime(2014, 01, 29, 12, 13, 14)
+ time = datetime(2014, 1, 29, 12, 13, 14)
header = _ChangelogHeader(RpmPkgPolicy, time, name="John Doe",
email="user@host.com", revision="1")
eq_(str(header), "* Wed Jan 29 2014 John Doe <user@host.com> 1\n")
def test_str_format_err(self):
"""Test missing properties"""
- time = datetime(2014, 01, 29, 12, 13, 14)
+ time = datetime(2014, 1, 29, 12, 13, 14)
header = _ChangelogHeader(RpmPkgPolicy, time, name="John", revision="1")
assert_raises(ChangelogError, str, header)
@@ -74,7 +74,7 @@ class TestChangelogSection(object):
def setup(self):
"""Initialize test"""
- time = datetime(2014, 01, 29, 12, 13, 14)
+ time = datetime(2014, 1, 29, 12, 13, 14)
self.default_sect = _ChangelogSection(RpmPkgPolicy, time, name="J. D.",
email="u@h", revision="1")
entry = _ChangelogEntry(RpmPkgPolicy, "J. D.", "- my change")
@@ -99,7 +99,7 @@ class TestChangelogSection(object):
def test_set_header(self):
"""Test set_header() method"""
section = self.default_sect
- time = datetime(2014, 01, 30)
+ time = datetime(2014, 1, 30)
section.set_header(time=time, name="Jane", email="u@h", revision="1.1")
eq_(str(section), "* Thu Jan 30 2014 Jane <u@h> 1.1\n- my change\n\n")
@@ -239,7 +239,7 @@ class TestChangelog(object):
def test_add_section(self):
"""Test the add_section() method"""
changelog = Changelog(RpmPkgPolicy)
- time = datetime(2014, 01, 30)
+ time = datetime(2014, 1, 30)
new_section = changelog.add_section(time=time, name="Jane Doe",
email="j@doe.com", revision="1.2")
eq_(str(changelog), "* Thu Jan 30 2014 Jane Doe <j@doe.com> 1.2\n\n")