Skip to content

Commit

Permalink
Fix method name in coriolisclient.cli.endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristi1324 authored and Dany9966 committed Apr 24, 2024
1 parent 9267bbb commit ce4c7a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions coriolisclient/cli/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def add_connection_info_args_to_parser(parser):
return parser


def get_connnection_info_from_args(args, raise_if_none=True):
def get_connection_info_from_args(args, raise_if_none=True):
""" Returns a dict with the connection info from the arguments. """
conn_info = None
raw_conn_info = None
Expand Down Expand Up @@ -148,7 +148,7 @@ def take_action(self, args):
"Please specify either --connection or "
"--connection-secret, but not both")

conn_info = get_connnection_info_from_args(args)
conn_info = get_connection_info_from_args(args)
endpoint = self.app.client_manager.coriolis.endpoints.create(
args.name,
args.provider,
Expand Down Expand Up @@ -191,7 +191,7 @@ def take_action(self, args):
"Please specify either --connection or "
"--connection-secret, but not both")

conn_info = get_connnection_info_from_args(args, raise_if_none=False)
conn_info = get_connection_info_from_args(args, raise_if_none=False)
updated_values = {}
if args.name is not None:
updated_values["name"] = args.name
Expand Down
30 changes: 15 additions & 15 deletions coriolisclient/tests/cli/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_add_connection_info_args_to_parser(self):
"expected_result": {"secret_ref": "mock_secret"}
},
)
def test_get_connnection_info_from_args(self, data):
def test_get_connection_info_from_args(self, data):
mock_args = mock.MagicMock()
(mock_args.connection,
mock_args.connection_file.__enter__.return_value.read.return_value,
Expand All @@ -62,11 +62,11 @@ def test_get_connnection_info_from_args(self, data):
if data["expected_result"] == "exception":
self.assertRaises(
ValueError,
endpoints.get_connnection_info_from_args,
endpoints.get_connection_info_from_args,
mock_args
)
else:
result = endpoints.get_connnection_info_from_args(
result = endpoints.get_connection_info_from_args(
mock_args, raise_if_none=data.get("raise_if_none", True))

self.assertEqual(
Expand Down Expand Up @@ -185,10 +185,10 @@ def test_get_parser(

@mock.patch.object(endpoints.EndpointDetailFormatter,
'get_formatted_entity')
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
@mock.patch.object(endpoints, 'get_connection_info_from_args')
def test_take_action(
self,
mock_get_connnection_info_from_args,
mock_get_connection_info_from_args,
mock_get_formatted_entity
):
args = mock.Mock()
Expand All @@ -212,11 +212,11 @@ def test_take_action(
mock_get_formatted_entity.return_value,
result
)
mock_get_connnection_info_from_args.assert_called_once_with(args)
mock_get_connection_info_from_args.assert_called_once_with(args)
mock_create.assert_called_once_with(
mock.sentinel.name,
mock.sentinel.provider,
mock_get_connnection_info_from_args.return_value,
mock_get_connection_info_from_args.return_value,
mock.sentinel.description,
regions=mock.sentinel.regions,
)
Expand All @@ -238,10 +238,10 @@ def test_take_action_raises_connection(self):

@mock.patch.object(endpoints.EndpointDetailFormatter,
'get_formatted_entity')
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
@mock.patch.object(endpoints, 'get_connection_info_from_args')
def test_take_action_validation_failed(
self,
mock_get_connnection_info_from_args,
mock_get_connection_info_from_args,
mock_get_formatted_entity
):
args = mock.Mock()
Expand All @@ -265,11 +265,11 @@ def test_take_action_validation_failed(
args
)

mock_get_connnection_info_from_args.assert_called_once_with(args)
mock_get_connection_info_from_args.assert_called_once_with(args)
mock_create.assert_called_once_with(
mock.sentinel.name,
mock.sentinel.provider,
mock_get_connnection_info_from_args.return_value,
mock_get_connection_info_from_args.return_value,
mock.sentinel.description,
regions=mock.sentinel.regions,
)
Expand Down Expand Up @@ -306,10 +306,10 @@ def test_get_parser(

@mock.patch.object(endpoints.EndpointDetailFormatter,
'get_formatted_entity')
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
@mock.patch.object(endpoints, 'get_connection_info_from_args')
def test_take_action(
self,
mock_get_connnection_info_from_args,
mock_get_connection_info_from_args,
mock_get_formatted_entity
):
args = mock.Mock()
Expand All @@ -325,7 +325,7 @@ def test_take_action(
expected_updated_values = {
"name": mock.sentinel.name,
"description": mock.sentinel.description,
"connection_info": (mock_get_connnection_info_from_args.
"connection_info": (mock_get_connection_info_from_args.
return_value),
"mapped_regions": mock.sentinel.regions,
}
Expand All @@ -336,7 +336,7 @@ def test_take_action(
mock_get_formatted_entity.return_value,
result
)
mock_get_connnection_info_from_args.assert_called_once_with(
mock_get_connection_info_from_args.assert_called_once_with(
args, raise_if_none=False)
mock_update.assert_called_once_with(
mock.sentinel.id,
Expand Down

0 comments on commit ce4c7a5

Please sign in to comment.