def test_main(self, mock_OBSImageBuildResultService, mock_config): config = Mock() mock_config.return_value = config main() mock_OBSImageBuildResultService.assert_called_once_with( service_exchange='obs', config=config)
def test_main_unexpected_error(self, mock_exit, mock_OBSImageBuildResultService, mock_config): mock_OBSImageBuildResultService.side_effect = Exception main() mock_exit.assert_called_once_with(1)
def test_main_keyboard_interrupt(self, mock_exit, mock_OBSImageBuildResultService, mock_config): mock_OBSImageBuildResultService.side_effect = KeyboardInterrupt main() mock_exit.assert_called_once_with(0)
def test_main_system_exit(self, mock_exit, mock_OBSImageBuildResultService, mock_config): mock_OBSImageBuildResultService.side_effect = SystemExit main() mock_exit.assert_called_once_with(0)
def test_main_mash_error(self, mock_exit, mock_OBSImageBuildResultService, mock_conofig): mock_OBSImageBuildResultService.side_effect = MashException('error') main() mock_exit.assert_called_once_with(1)