Skip to content

Commit

Permalink
Fix existing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dany9966 committed Aug 8, 2024
1 parent ef0e10a commit 7356b56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion coriolisclient/cli/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ def get_parser(self, prog_name):
return parser

def take_action(self, args):
self.app.client_manager.coriolis.deployments.cancel(args.id, args.force)
self.app.client_manager.coriolis.deployments.cancel(
args.id, args.force)


class DeleteDeployment(command.Command):
Expand Down
6 changes: 6 additions & 0 deletions coriolisclient/tests/cli/test_replicas.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ def test_get_formatted_data(self):
obj.last_execution_status = mock.sentinel.last_execution_status
obj.instances = ["mock_instance3", "mock_instance1", "mock_instance2"]
obj.notes = mock.sentinel.notes
obj.scenario = mock.sentinel.scenario
obj.created_at = mock.sentinel.created_at

result = self.replica._get_formatted_data(obj)

self.assertEqual(
(
mock.sentinel.id,
mock.sentinel.scenario,
('mock_instance3%(ls)smock_instance1%(ls)smock_instance2'
% {"ls": "\n"}),
mock.sentinel.notes,
Expand Down Expand Up @@ -211,10 +213,12 @@ def test_get_formatted_data(
mock_format_executions.return_value = \
mock.sentinel.formatted_executions
mock_obj.info = mock.sentinel.info
mock_obj.scenario = mock.sentinel.scenario
expected_result = [
mock.sentinel.id,
mock.sentinel.created_at,
mock.sentinel.updated_at,
mock.sentinel.scenario,
mock.sentinel.reservation_id,
mock.sentinel.formatted_instances,
mock.sentinel.notes,
Expand Down Expand Up @@ -281,6 +285,7 @@ def test_take_action(
args = mock.Mock()
args.instances = mock.sentinel.instances
args.notes = mock.sentinel.notes
args.scenario = mock.sentinel.scenario
args.origin_minion_pool_id = mock.sentinel.origin_minion_pool_id
args.destination_minion_pool_id = \
mock.sentinel.destination_minion_pool_id
Expand Down Expand Up @@ -315,6 +320,7 @@ def test_take_action(
mock.sentinel.source_environment,
mock.sentinel.destination_environment,
mock.sentinel.instances,
mock.sentinel.scenario,
network_map=mock.sentinel.network_map,
notes=mock.sentinel.notes,
storage_mappings=(mock_get_storage_mappings_dict_from_args.
Expand Down
3 changes: 2 additions & 1 deletion coriolisclient/v1/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def list(self, detail=False):
return self._list(path, 'deployments')

def get(self, deployment):
return self._get('/deployments/%s' % base.getid(deployment), 'deployment')
return self._get(
'/deployments/%s' % base.getid(deployment), 'deployment')

def create_from_replica(self, replica_id, clone_disks=True, force=False,
skip_os_morphing=False, user_scripts=None,
Expand Down

0 comments on commit 7356b56

Please sign in to comment.