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
commitfd25d50088f5ca231195123fd511f491ebbb96e2 (patch)
tree062954615a1abe60b756d5cfd6ce9ee19bfb12de /tests/component
parent9b9dbd5637aeef9974e02c16cb80e1babf5994f9 (diff)
rpm component tests: bytes vs strings in paths
Diffstat (limited to 'tests/component')
-rw-r--r--tests/component/rpm/test_buildpackage_rpm.py6
-rw-r--r--tests/component/rpm/test_rpm_ch.py26
2 files changed, 16 insertions, 16 deletions
diff --git a/tests/component/rpm/test_buildpackage_rpm.py b/tests/component/rpm/test_buildpackage_rpm.py
index 1ab883fe..4193e1d7 100644
--- a/tests/component/rpm/test_buildpackage_rpm.py
+++ b/tests/component/rpm/test_buildpackage_rpm.py
@@ -414,7 +414,7 @@ class TestGbpRpm(RpmRepoTestBase):
# Test
eq_(mock_gbp(['--git-submodules']), 0)
zip_files = ls_zip('../rpmbuild/SOURCES/gbp-test-native-1.0.zip', False)
- ref_files = master_files + ['gbp-test-native-1.0/gbp-test-native2.repo/' + path for
+ ref_files = master_files + ['gbp-test-native-1.0/gbp-test-native2.repo/' + path.decode() for
path in sub_files]
self.check_files(ref_files, zip_files)
@@ -556,7 +556,7 @@ class TestGbpRpm(RpmRepoTestBase):
base_args = ['--git-ignore-new', '--git-builder=true']
# Test exporting of git index
- foo_txt_index = repo.show('HEAD:foo.txt') + 'staged'
+ foo_txt_index = repo.show('HEAD:foo.txt').decode() + 'staged'
eq_(mock_gbp(base_args + ['--git-export=INDEX']), 0)
self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_index)
ok_(not os.path.exists('../rpmbuild/SOURCES/untracked'))
@@ -565,7 +565,7 @@ class TestGbpRpm(RpmRepoTestBase):
# Test exporting of working copy (include all files)
eq_(mock_gbp(base_args + ['--git-export=WC']), 0)
- foo_txt_wc = repo.show('HEAD:foo.txt') + 'staged' + 'unstaged'
+ foo_txt_wc = repo.show('HEAD:foo.txt').decode() + 'staged' + 'unstaged'
self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_wc)
self.check_and_rm_file('../rpmbuild/SOURCES/untracked', 'untracked')
self.check_and_rm_file('../rpmbuild/SOURCES/ignored.tmp', 'ignored')
diff --git a/tests/component/rpm/test_rpm_ch.py b/tests/component/rpm/test_rpm_ch.py
index 8da347b3..97f5d7e6 100644
--- a/tests/component/rpm/test_rpm_ch.py
+++ b/tests/component/rpm/test_rpm_ch.py
@@ -70,13 +70,13 @@ class TestRpmCh(RpmRepoTestBase):
"""Test updating changelog in spec"""
repo = self.init_test_repo('gbp-test')
eq_(mock_ch([]), 0)
- eq_(repo.status(), {' M': ['gbp-test.spec']})
+ eq_(repo.status(), {' M': [b'gbp-test.spec']})
def test_update_changes_file(self):
"""Test updating a separate changes file"""
repo = self.init_test_repo('gbp-test-native')
eq_(mock_ch([]), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
def test_create_spec_changelog(self):
"""Test creating changelog in spec file"""
@@ -89,7 +89,7 @@ class TestRpmCh(RpmRepoTestBase):
# Give starting point
eq_(mock_ch(['--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test2.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test2.spec']})
content = self.read_file('packaging/gbp-test2.spec')
# Should contain 4 lines (%changelog, header, 1 entry and an empty line)
eq_(len(content), len(orig_content) + 4)
@@ -104,7 +104,7 @@ class TestRpmCh(RpmRepoTestBase):
# Give starting point
eq_(mock_ch(['--since=HEAD^', '--changelog-file=CHANGES']), 0)
- eq_(repo.status(), {'??': ['packaging/gbp-test2.changes']})
+ eq_(repo.status(), {'??': [b'packaging/gbp-test2.changes']})
content = self.read_file('packaging/gbp-test2.changes')
# Should contain 3 lines (header, 1 entry and an empty line)
eq_(len(content), 3)
@@ -115,18 +115,18 @@ class TestRpmCh(RpmRepoTestBase):
# Guess changelog file
eq_(mock_ch(['--changelog-file=CHANGES']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
# Use spec file as changelog
eq_(mock_ch(['--changelog-file=SPEC', '--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes',
- 'packaging/gbp-test-native.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes',
+ b'packaging/gbp-test-native.spec']})
# Arbitrary name
eq_(mock_ch(['--changelog-file=foo.changes', '--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes',
- 'packaging/gbp-test-native.spec'],
- '??': ['foo.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes',
+ b'packaging/gbp-test-native.spec'],
+ '??': [b'foo.changes']})
def test_option_spec_file(self):
"""Test the --spec-file cmdline option"""
@@ -140,7 +140,7 @@ class TestRpmCh(RpmRepoTestBase):
eq_(mock_ch(['--spec-file=packaging/gbp-test2.spec', '--since=HEAD^']),
0)
- eq_(repo.status(), {' M': ['packaging/gbp-test2.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test2.spec']})
def test_option_packaging_dir(self):
"""Test the --packaging-dir cmdline option"""
@@ -152,7 +152,7 @@ class TestRpmCh(RpmRepoTestBase):
# Packaging dir should be taken from spec file if it is defined
eq_(mock_ch(['--packaging-dir', 'foo', '--spec-file',
'packaging/gbp-test-native.spec']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
def test_branch_options(self):
"""Test the --packaging-branch and --ignore-branch cmdline options"""
@@ -259,7 +259,7 @@ class TestRpmCh(RpmRepoTestBase):
"""Test the --editor-cmd and --spawn-editor cmdline options"""
repo = self.init_test_repo('gbp-test-native')
eq_(mock_ch(['--spawn-editor=release', '--editor-cmd=rm']), 0)
- eq_(repo.status(), {' D': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' D': [b'packaging/gbp-test-native.changes']})
repo.force_head('HEAD', hard=True)
ok_(repo.is_clean())