Skip to content

Commit ce4c7a5

Browse files
Cristi1324Dany9966
authored andcommitted
Fix method name in coriolisclient.cli.endpoints
1 parent 9267bbb commit ce4c7a5

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

coriolisclient/cli/endpoints.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def add_connection_info_args_to_parser(parser):
4343
return parser
4444

4545

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

151-
conn_info = get_connnection_info_from_args(args)
151+
conn_info = get_connection_info_from_args(args)
152152
endpoint = self.app.client_manager.coriolis.endpoints.create(
153153
args.name,
154154
args.provider,
@@ -191,7 +191,7 @@ def take_action(self, args):
191191
"Please specify either --connection or "
192192
"--connection-secret, but not both")
193193

194-
conn_info = get_connnection_info_from_args(args, raise_if_none=False)
194+
conn_info = get_connection_info_from_args(args, raise_if_none=False)
195195
updated_values = {}
196196
if args.name is not None:
197197
updated_values["name"] = args.name

coriolisclient/tests/cli/test_endpoints.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_add_connection_info_args_to_parser(self):
5151
"expected_result": {"secret_ref": "mock_secret"}
5252
},
5353
)
54-
def test_get_connnection_info_from_args(self, data):
54+
def test_get_connection_info_from_args(self, data):
5555
mock_args = mock.MagicMock()
5656
(mock_args.connection,
5757
mock_args.connection_file.__enter__.return_value.read.return_value,
@@ -62,11 +62,11 @@ def test_get_connnection_info_from_args(self, data):
6262
if data["expected_result"] == "exception":
6363
self.assertRaises(
6464
ValueError,
65-
endpoints.get_connnection_info_from_args,
65+
endpoints.get_connection_info_from_args,
6666
mock_args
6767
)
6868
else:
69-
result = endpoints.get_connnection_info_from_args(
69+
result = endpoints.get_connection_info_from_args(
7070
mock_args, raise_if_none=data.get("raise_if_none", True))
7171

7272
self.assertEqual(
@@ -185,10 +185,10 @@ def test_get_parser(
185185

186186
@mock.patch.object(endpoints.EndpointDetailFormatter,
187187
'get_formatted_entity')
188-
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
188+
@mock.patch.object(endpoints, 'get_connection_info_from_args')
189189
def test_take_action(
190190
self,
191-
mock_get_connnection_info_from_args,
191+
mock_get_connection_info_from_args,
192192
mock_get_formatted_entity
193193
):
194194
args = mock.Mock()
@@ -212,11 +212,11 @@ def test_take_action(
212212
mock_get_formatted_entity.return_value,
213213
result
214214
)
215-
mock_get_connnection_info_from_args.assert_called_once_with(args)
215+
mock_get_connection_info_from_args.assert_called_once_with(args)
216216
mock_create.assert_called_once_with(
217217
mock.sentinel.name,
218218
mock.sentinel.provider,
219-
mock_get_connnection_info_from_args.return_value,
219+
mock_get_connection_info_from_args.return_value,
220220
mock.sentinel.description,
221221
regions=mock.sentinel.regions,
222222
)
@@ -238,10 +238,10 @@ def test_take_action_raises_connection(self):
238238

239239
@mock.patch.object(endpoints.EndpointDetailFormatter,
240240
'get_formatted_entity')
241-
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
241+
@mock.patch.object(endpoints, 'get_connection_info_from_args')
242242
def test_take_action_validation_failed(
243243
self,
244-
mock_get_connnection_info_from_args,
244+
mock_get_connection_info_from_args,
245245
mock_get_formatted_entity
246246
):
247247
args = mock.Mock()
@@ -265,11 +265,11 @@ def test_take_action_validation_failed(
265265
args
266266
)
267267

268-
mock_get_connnection_info_from_args.assert_called_once_with(args)
268+
mock_get_connection_info_from_args.assert_called_once_with(args)
269269
mock_create.assert_called_once_with(
270270
mock.sentinel.name,
271271
mock.sentinel.provider,
272-
mock_get_connnection_info_from_args.return_value,
272+
mock_get_connection_info_from_args.return_value,
273273
mock.sentinel.description,
274274
regions=mock.sentinel.regions,
275275
)
@@ -306,10 +306,10 @@ def test_get_parser(
306306

307307
@mock.patch.object(endpoints.EndpointDetailFormatter,
308308
'get_formatted_entity')
309-
@mock.patch.object(endpoints, 'get_connnection_info_from_args')
309+
@mock.patch.object(endpoints, 'get_connection_info_from_args')
310310
def test_take_action(
311311
self,
312-
mock_get_connnection_info_from_args,
312+
mock_get_connection_info_from_args,
313313
mock_get_formatted_entity
314314
):
315315
args = mock.Mock()
@@ -325,7 +325,7 @@ def test_take_action(
325325
expected_updated_values = {
326326
"name": mock.sentinel.name,
327327
"description": mock.sentinel.description,
328-
"connection_info": (mock_get_connnection_info_from_args.
328+
"connection_info": (mock_get_connection_info_from_args.
329329
return_value),
330330
"mapped_regions": mock.sentinel.regions,
331331
}
@@ -336,7 +336,7 @@ def test_take_action(
336336
mock_get_formatted_entity.return_value,
337337
result
338338
)
339-
mock_get_connnection_info_from_args.assert_called_once_with(
339+
mock_get_connection_info_from_args.assert_called_once_with(
340340
args, raise_if_none=False)
341341
mock_update.assert_called_once_with(
342342
mock.sentinel.id,

0 commit comments

Comments
 (0)