summaryrefslogtreecommitdiffhomepage
path: root/tests/component
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-08-02 01:32:37 -0300
committerGuido Günther <agx@sigxcpu.org>2017-08-02 10:35:05 -0300
commitc2dd747a1de9fe205c143f059dc98f98b7f8c3af (patch)
tree9c97e0bad048683d3c4827866db5e6222ace497d /tests/component
parentdd2093b111bdf069cc989952ac7e8c3781c948cc (diff)
fixup! rpm component tests: bytes vs strings in paths and data
Diffstat (limited to 'tests/component')
-rw-r--r--tests/component/rpm/test_buildpackage_rpm.py8
-rw-r--r--tests/component/rpm/test_import_srpm.py2
-rw-r--r--tests/component/rpm/test_pq_rpm.py10
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/component/rpm/test_buildpackage_rpm.py b/tests/component/rpm/test_buildpackage_rpm.py
index e236cf45..f9700583 100644
--- a/tests/component/rpm/test_buildpackage_rpm.py
+++ b/tests/component/rpm/test_buildpackage_rpm.py
@@ -250,7 +250,7 @@ class TestGbpRpm(RpmRepoTestBase):
# Dummy update to upstream branch
pkg_branch = repo.get_branch()
upstr_branch = 'upstream'
- orig_files = ['gbp-test/' + path for
+ orig_files = ['gbp-test/' + path.decode() for
path in repo.ls_tree(upstr_branch)] + ['gbp-test']
repo.set_branch(upstr_branch)
for fname in ['new-file', 'new-file2']:
@@ -372,7 +372,7 @@ class TestGbpRpm(RpmRepoTestBase):
repo.set_branch(pkg_branch)
sub_files = sub_repo.ls_tree('HEAD')
- upstr_files = ['gbp-test/' + path for
+ upstr_files = ['gbp-test/' + path.decode() for
path in repo.ls_tree(upstr_branch)]
# Test the "no" option
@@ -386,7 +386,7 @@ class TestGbpRpm(RpmRepoTestBase):
eq_(mock_gbp(['--git-submodules', '--git-upstream-tree=%s' %
upstr_branch, '--git-ignore-new']), 0)
tar_files = ls_tar('../rpmbuild/SOURCES/gbp-test-1.1.tar.bz2', False)
- ref_files = upstr_files + ['gbp-test/gbp-test-native.repo/' + path for
+ ref_files = upstr_files + ['gbp-test/gbp-test-native.repo/' + path.decode() for
path in sub_files]
self.check_files(ref_files, tar_files)
shutil.rmtree('../rpmbuild')
@@ -411,7 +411,7 @@ class TestGbpRpm(RpmRepoTestBase):
repo.commit_all('Add submodule')
sub_files = sub_repo.ls_tree('HEAD')
- master_files = ['gbp-test-native-1.0/' + path for
+ master_files = ['gbp-test-native-1.0/' + path.decode() for
path in repo.ls_tree('HEAD')]
# Test
diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py
index 3e153f1d..fd73d954 100644
--- a/tests/component/rpm/test_import_srpm.py
+++ b/tests/component/rpm/test_import_srpm.py
@@ -282,7 +282,7 @@ class TestDownloadImport(ComponentTestBase):
# Mock to use local files instead of really downloading
local_fn = os.path.join(DATA_DIR, os.path.basename(srpm))
import_srpm.urlopen = Mock()
- import_srpm.urlopen.return_value = open(local_fn, 'r')
+ import_srpm.urlopen.return_value = open(local_fn, 'rb')
eq_(mock_import(['--no-pristine-tar', srpm]), 0)
# Check repository state
diff --git a/tests/component/rpm/test_pq_rpm.py b/tests/component/rpm/test_pq_rpm.py
index 05f93806..baa12218 100644
--- a/tests/component/rpm/test_pq_rpm.py
+++ b/tests/component/rpm/test_pq_rpm.py
@@ -92,7 +92,7 @@ class TestPqRpm(RpmRepoTestBase):
files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
'gbp-test.spec'] + patches
self._check_repo_state(repo, 'master', branches, files)
- eq_(repo.status()[' M'], ['gbp-test.spec'])
+ eq_(repo.status()[' M'], [b'gbp-test.spec'])
self._has_patches('gbp-test.spec', patches)
# Another export after removing some patches
@@ -117,7 +117,7 @@ class TestPqRpm(RpmRepoTestBase):
eq_(mock_pq(['export', '--upstream-tag', 'upstream/%(version)s',
'--spec-file', 'packaging/gbp-test2.spec']), 0)
self._check_repo_state(repo, 'master-orphan', branches)
- eq_(repo.status()[' M'], ['packaging/gbp-test2.spec'])
+ eq_(repo.status()[' M'], [b'packaging/gbp-test2.spec'])
self._has_patches('packaging/gbp-test2.spec', patches)
def test_rebase(self):
@@ -184,11 +184,11 @@ class TestPqRpm(RpmRepoTestBase):
def test_force_import(self):
"""Test force import"""
repo = self.init_test_repo('gbp-test')
- pkg_files = repo.list_files()
+ pkg_files = [f.decode() for f in repo.list_files()]
repo.rename_branch('pq/master', 'patch-queue/master')
repo.set_branch('patch-queue/master')
branches = repo.get_local_branches()
- pq_files = repo.list_files()
+ pq_files = [f.decode() for f in repo.list_files()]
# Re-import should fail
eq_(mock_pq(['import']), 1)
@@ -324,7 +324,7 @@ class TestPqRpm(RpmRepoTestBase):
repo.commit_dir('.', 'Merge with master', 'patch-queue/master',
['master'])
merge_rev = repo.rev_parse('HEAD', short=7)
- eq_(mock_pq(['apply', patches[0]]), 0)
+ eq_(mock_pq(['apply', patches[0].decode()]), 0)
upstr_rev = repo.rev_parse('upstream', short=7)
os.unlink(patches[0])