Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 9, 2024
1 parent 4917df8 commit 43a9f9d
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,21 @@ def fixture_aws_identity():
class TestAWSAPI:
def test_login(self, fixture_aws_mock_api, fixture_aws_identity):
api = fixture_aws_mock_api
with patch(
"JciHitachi.aws_connection.GetUser.get_data"
) as mock_get_data_get_user, patch(
"JciHitachi.aws_connection.GetUser.login"
) as mock_login_get_user, patch(
"JciHitachi.aws_connection.ListSubUser.get_data"
) as mock_get_data_list_subuser, patch(
"JciHitachi.aws_connection.GetAllDevice.get_data"
) as mock_get_data_get_all_device, patch(
"JciHitachi.aws_connection.JciHitachiAWSMqttConnection.connect"
) as mock_connect_mqtt:
with (
patch(
"JciHitachi.aws_connection.GetUser.get_data"
) as mock_get_data_get_user,
patch("JciHitachi.aws_connection.GetUser.login") as mock_login_get_user,
patch(
"JciHitachi.aws_connection.ListSubUser.get_data"
) as mock_get_data_list_subuser,
patch(
"JciHitachi.aws_connection.GetAllDevice.get_data"
) as mock_get_data_get_all_device,
patch(
"JciHitachi.aws_connection.JciHitachiAWSMqttConnection.connect"
) as mock_connect_mqtt,
):
# initialization
aws_tokens = api._aws_tokens
api._aws_tokens = None
Expand Down Expand Up @@ -182,11 +186,14 @@ def test_login(self, fixture_aws_mock_api, fixture_aws_identity):

def test_change_password(self, fixture_aws_mock_api):
api = fixture_aws_mock_api
with patch(
"JciHitachi.aws_connection.ChangePassword.get_data"
) as mock_get_data_1, patch(
"JciHitachi.connection.UpdateUserCredential.get_data"
) as mock_get_data_2:
with (
patch(
"JciHitachi.aws_connection.ChangePassword.get_data"
) as mock_get_data_1,
patch(
"JciHitachi.connection.UpdateUserCredential.get_data"
) as mock_get_data_2,
):
mock_get_data_1.return_value = ("OK", "")
mock_get_data_2.return_value = ("OK", "")
api.change_password("new_password")
Expand Down

0 comments on commit 43a9f9d

Please sign in to comment.