From b61a8d182d9fcbda2e681e7dad18a06f7fa1c8bb Mon Sep 17 00:00:00 2001 From: Elias KA Date: Mon, 23 Dec 2024 20:05:07 +0100 Subject: [PATCH] [QI2-1176] Added linting --- tests/cli/test_command_list.py | 6 ++---- tests/util/test_configuration.py | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/cli/test_command_list.py b/tests/cli/test_command_list.py index 1339e96f..72d86412 100644 --- a/tests/cli/test_command_list.py +++ b/tests/cli/test_command_list.py @@ -108,6 +108,7 @@ def test_results_get(mocker: MockerFixture) -> None: assert result.exit_code == 0 mock_remote_backend_inst.get_results.assert_called_once() + def test_results_get_no_results(mocker: MockerFixture) -> None: mock_remote_backend_inst = MagicMock() mock_remote_backend_inst.get_results.return_value = None @@ -140,10 +141,7 @@ def test_final_results_get_no_results(mocker: MockerFixture) -> None: mock_remote_backend_inst.get_final_results.assert_called_once() -@pytest.mark.parametrize("use_local_auth_config", [ - True, - False -]) +@pytest.mark.parametrize("use_local_auth_config", [True, False]) def test_login(mocker: MockerFixture, mocked_config_file: MagicMock, use_local_auth_config: bool) -> None: device_session = mocker.patch("quantuminspire.cli.command_list.OauthDeviceSession")() webbrowser_open = mocker.patch("quantuminspire.cli.command_list.webbrowser.open") diff --git a/tests/util/test_configuration.py b/tests/util/test_configuration.py index b5e9be35..d068406c 100644 --- a/tests/util/test_configuration.py +++ b/tests/util/test_configuration.py @@ -25,9 +25,7 @@ def test_force_file_into_existence_file_does_not_exist(mocked_config_file: Magic configuration.ensure_config_file_exists(mocked_config_file, "utf-8") mocked_config_file.parent.mkdir.assert_called_once_with(parents=True, exist_ok=True) mocked_config_file.open.assert_called_once_with("w", encoding="utf-8") - open_mock.write.assert_called_once_with( - configuration.DEFAULT_CONFIG - ) + open_mock.write.assert_called_once_with(configuration.DEFAULT_CONFIG) def test_force_file_into_existence_file_exists() -> None: @@ -134,12 +132,10 @@ def __init__(self, items_list: list[Member]) -> None: assert member_id == expected_member_id assert mock_input.call_count == len(side_effect_user_input) + @pytest.mark.parametrize( "host", - [ - "https://test.host", - None - ], + ["https://test.host", None], ) async def test_fetch_suggested_auth_settings(mocked_config_file: MagicMock, mocker: MockerFixture, host: str) -> None: settings = configuration.Settings() @@ -160,4 +156,4 @@ async def test_fetch_suggested_auth_settings(mocked_config_file: MagicMock, mock assert auth_settings.client_id == "test_client_id" assert auth_settings.audience == "test_audience" - assert auth_settings.well_known_endpoint == "https://test.endpoint/.well-known/config" \ No newline at end of file + assert auth_settings.well_known_endpoint == "https://test.endpoint/.well-known/config"