예제 #1
0
 def test_reset_packages_conflict(self, mocker):
     self.patch(mocker)
     assert release.RETCODE_EINVAL == release.route(args=self.make_args(
         reset_packages=True, reset_url=True),
                                                    argv=['test', '-p'])
     assert release.RETCODE_EINVAL == release.route(args=self.make_args(
         reset_packages=True, target_release='new_release'),
                                                    argv=['test', '-p'])
     assert release.RETCODE_EINVAL == release.route(args=self.make_args(
         reset_packages=True, prefix='new/prefix'),
                                                    argv=['test', '-p'])
예제 #2
0
 def test_new_state_not_exist(self, mocker):
     state = release.SystemState('testing', 'wb6/stretch', '', True)
     new_state = release.SystemState('stable', 'wb6/stretch', '', True)
     self.patch(mocker, state, release_exists=False)
     assert release.RETCODE_NO_TARGET == release.route(
         args=self.make_args(target_release='stable'), argv=['test', '-t'])
     release.release_exists.assert_called_once_with(new_state)
     release.update_system.assert_not_called()
예제 #3
0
 def test_reset_packages_route(self, mocker):
     state = release.SystemState('testing', 'wb6/stretch', '', True)
     self.patch(mocker, state)
     assert release.RETCODE_OK == release.route(
         args=self.make_args(reset_packages=True), argv=['test', '-p'])
     release.update_system.assert_called_once_with(state,
                                                   state,
                                                   second_stage=True,
                                                   assume_yes=False,
                                                   log_filename=None)
예제 #4
0
 def test_old_state_inconsistent(self, mocker):
     state = release.SystemState('testing', 'wb6/stretch', '', False)
     new_state = release.SystemState('testing', 'wb6/stretch', '', True)
     self.patch(mocker, state)
     assert release.RETCODE_OK == release.route(
         args=self.make_args(target_release='testing'), argv=['test', '-t'])
     release.release_exists.assert_called_once_with(new_state)
     release.update_system.assert_called_once_with(new_state,
                                                   state,
                                                   second_stage=False,
                                                   assume_yes=False,
                                                   log_filename=None)
예제 #5
0
 def test_same_state(self, mocker):
     state = release.SystemState('testing', 'wb6/stretch', '', True)
     self.patch(mocker, state)
     assert release.RETCODE_OK == release.route(
         args=self.make_args(target_release='testing'), argv=['test', '-t'])
예제 #6
0
 def test_regenerate_config(self, mocker):
     state = release.SystemState('testing', 'wb6/stretch', '', True)
     self.patch(mocker, state)
     assert release.RETCODE_OK == release.route(
         args=self.make_args(regenerate=True), argv=['test', '-r'])
     release.generate_system_config.assert_called_once_with(state)
예제 #7
0
 def test_print_banner_version(self, mocker):
     self.patch(mocker)
     assert release.RETCODE_OK == release.route(
         args=self.make_args(version=True), argv=['test', '-v'])
     release.print_banner.assert_called_once_with()
예제 #8
0
 def test_print_banner_empty(self, mocker):
     self.patch(mocker)
     assert release.RETCODE_OK == release.route(args=self.make_args(),
                                                argv=['test'])
     release.print_banner.assert_called_once_with()