| |
@@ -43,9 +43,9 @@
|
| |
self.mock_run_command = self.run_command_patcher.start()
|
| |
|
| |
# Let's always use the bodhi 2 command line to test here
|
| |
- self.get_bodhi_version_patcher = patch('fedpkg._get_bodhi_version',
|
| |
- return_value=[2, 11, 0])
|
| |
- self.mock_get_bodhi_version = self.get_bodhi_version_patcher.start()
|
| |
+ self.is_el6_system_patcher = patch('fedpkg.is_el6_system',
|
| |
+ return_value=False)
|
| |
+ self.mock_is_el6_system = self.is_el6_system_patcher.start()
|
| |
|
| |
# Not write clog actually. Instead, file object will be mocked and
|
| |
# return fake clog content for tests.
|
| |
@@ -64,7 +64,7 @@
|
| |
def tearDown(self):
|
| |
self.os_environ_patcher.stop()
|
| |
self.clog_patcher.stop()
|
| |
- self.get_bodhi_version_patcher.stop()
|
| |
+ self.is_el6_system_patcher.stop()
|
| |
self.run_command_patcher.stop()
|
| |
self.nvr_patcher.stop()
|
| |
super(TestUpdate, self).tearDown()
|
| |
@@ -151,28 +151,10 @@
|
| |
@patch('os.path.isfile', return_value=True)
|
| |
@patch('hashlib.new')
|
| |
@patch('fedpkg.lookaside.FedoraLookasideCache.hash_file')
|
| |
- def test_fail_if_bodhi_version_is_not_supported(
|
| |
- self, hash_file, hashlib_new, isfile):
|
| |
- # As of writing this test, only supports version v3, v2, and <v2.
|
| |
- self.mock_get_bodhi_version.return_value = [4, 1, 2]
|
| |
- hashlib_new.return_value.hexdigest.return_value = 'origin hash'
|
| |
- hash_file.return_value = 'different hash'
|
| |
-
|
| |
- cli_cmd = ['fedpkg', '--path', self.cloned_repo_path, 'update']
|
| |
-
|
| |
- cli = self.get_cli(cli_cmd)
|
| |
- six.assertRaisesRegex(
|
| |
- self, rpkgError, 'This system has bodhi v4, which is unsupported',
|
| |
- self.create_bodhi_update, cli)
|
| |
-
|
| |
- @patch('os.path.isfile', return_value=True)
|
| |
- @patch('hashlib.new')
|
| |
- @patch('fedpkg.lookaside.FedoraLookasideCache.hash_file')
|
| |
@patch('fedpkg.Commands.user', new_callable=PropertyMock)
|
| |
def test_create_update_in_stage_bodhi(
|
| |
self, user, hash_file, hashlib_new, isfile):
|
| |
user.return_value = 'someone'
|
| |
- self.mock_get_bodhi_version.return_value = [2, 8, 1]
|
| |
hashlib_new.return_value.hexdigest.return_value = 'origin hash'
|
| |
hash_file.return_value = 'different hash'
|
| |
|
| |
So far, EL6 is still needed to be considered for fedpkg, so
bodhi-client 1.x must be supported as well.
This patch does not check bodhi-client version to select proper version
of bodhi-client. Instead, if current system is EL6, version 1.x is
selected, otherwise bodhi command line will be constructed in the 2.x
format. This avoids fedpkg to be updated and released when each time a
new version of bodhi-client with increased major version is released.
Fixes #171
Signed-off-by: Chenxiong Qi cqi@redhat.com