summaryrefslogtreecommitdiffhomepage
path: root/tests/component/rpm
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-07-04 20:03:26 +0200
committerGuido Günther <agx@sigxcpu.org>2016-07-04 21:02:54 +0200
commitf545010462b9a313fe3bf160bca9e44c3ea77b55 (patch)
tree31c7f3a7d469b113c60b71d0f4d15bc459ea7c4c /tests/component/rpm
parentf2ad919cb98b3e1b1a537e2a43ece88961006b29 (diff)
Give more instructions when config is unparseable
and make return codes and messages consistent. This allows us to move some test code from the component tests to the unit tests which is always nice. Closes: #733640
Diffstat (limited to 'tests/component/rpm')
-rw-r--r--tests/component/rpm/test_buildpackage_rpm.py13
-rw-r--r--tests/component/rpm/test_pq_rpm.py10
-rw-r--r--tests/component/rpm/test_rpm_ch.py10
3 files changed, 1 insertions, 32 deletions
diff --git a/tests/component/rpm/test_buildpackage_rpm.py b/tests/component/rpm/test_buildpackage_rpm.py
index 29b6df3d..ab3d5795 100644
--- a/tests/component/rpm/test_buildpackage_rpm.py
+++ b/tests/component/rpm/test_buildpackage_rpm.py
@@ -106,17 +106,6 @@ class TestGbpRpm(RpmRepoTestBase):
self._check_log(0, 'gbp:error: %s is not a git repository' %
os.path.abspath('.'))
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create and commit dummy invalid config file
- repo = GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- repo.add_files('.gbp.conf')
- repo.commit_all('Add conf')
- eq_(mock_gbp([]), 1)
- self._check_log(0, 'gbp:error: File contains no section headers.')
-
def test_native_build(self):
"""Basic test of native pkg"""
self.init_test_repo('gbp-test-native')
@@ -224,7 +213,7 @@ class TestGbpRpm(RpmRepoTestBase):
eq_(mock_gbp(['--git-tag', '--git-packaging-tag=rel-tag']), 1)
# Re-tag
- eq_(mock_gbp(['--git-retag', '--git-packaging-tag=rel-tag']), 1)
+ eq_(mock_gbp(['--git-retag', '--git-packaging-tag=rel-tag']), 3)
self._check_log(-1, "gbp:error: '--git-retag' needs either '--git-tag'")
eq_(mock_gbp(['--git-tag', '--git-packaging-tag=rel-tag',
diff --git a/tests/component/rpm/test_pq_rpm.py b/tests/component/rpm/test_pq_rpm.py
index 3746fb91..c329f7a5 100644
--- a/tests/component/rpm/test_pq_rpm.py
+++ b/tests/component/rpm/test_pq_rpm.py
@@ -61,16 +61,6 @@ class TestPqRpm(RpmRepoTestBase):
self._check_log(0, 'gbp:error: %s is not a git repository' %
os.path.abspath(os.getcwd()))
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create dummy invalid config file and run pq-rpm
- GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- eq_(mock_pq(['foo']), 1)
- self._check_log(0, 'gbp:error: Invalid config file: File contains no '
- 'section headers.')
-
def test_import_export(self):
"""Basic test for patch import and export"""
repo = self.init_test_repo('gbp-test')
diff --git a/tests/component/rpm/test_rpm_ch.py b/tests/component/rpm/test_rpm_ch.py
index b55c6690..6cfa4035 100644
--- a/tests/component/rpm/test_rpm_ch.py
+++ b/tests/component/rpm/test_rpm_ch.py
@@ -65,16 +65,6 @@ class TestRpmCh(RpmRepoTestBase):
eq_(mock_ch([]), 1)
self._check_log(0, 'gbp:error: No Git repository at ')
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create dummy invalid config file and run git-rpm-ch
- GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- eq_(mock_ch([]), 1)
- self._check_log(0, 'gbp:error: invalid config file: File contains no '
- 'section headers.')
-
def test_update_spec_changelog(self):
"""Test updating changelog in spec"""
repo = self.init_test_repo('gbp-test')