Skip to content

Commit

Permalink
[QI2-1176] Added linting
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasKA committed Dec 31, 2024
1 parent 4523f75 commit b61a8d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions tests/cli/test_command_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
12 changes: 4 additions & 8 deletions tests/util/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand All @@ -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"
assert auth_settings.well_known_endpoint == "https://test.endpoint/.well-known/config"

0 comments on commit b61a8d1

Please sign in to comment.