Skip to content

Commit

Permalink
✅ Fix breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed Aug 28, 2024
1 parent 7d63b8f commit 7a21be5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/commands/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ def mock_azure_sdk_blob_exists_false(mocker):
mocker.patch.object(AzureSdk, "blob_exists", return_value=False)


@fixture
def mock_contextmanager_assert_context(mocker, context) -> Context:
context._entra_application_secret = "dummy-secret" # noqa: S105
mocker.patch.object(ContextManager, "assert_context", return_value=context)


@fixture
def mock_graph_api_add_custom_domain(mocker):
mocker.patch.object(
GraphApi, "add_custom_domain", return_value="dummy-verification-record"
)


@fixture
def mock_graph_api_get_application_by_name(mocker, request):
mocker.patch.object(
GraphApi,
"get_application_by_name",
return_value={"appId": request.config.guid_application},
)


@fixture
def mock_graph_api_token(mocker):
mocker.patch.object(GraphApi, "token", return_value="dummy-token")
Expand Down
2 changes: 2 additions & 0 deletions tests/commands/test_sre.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ def test_deploy(
self,
runner,
mock_graph_api_token, # noqa: ARG002
mock_contextmanager_assert_context, # noqa: ARG002
mock_ip_1_2_3_4, # noqa: ARG002
mock_pulumi_config_from_remote_or_create, # noqa: ARG002
mock_pulumi_config_upload, # noqa: ARG002
mock_shm_config_from_remote, # noqa: ARG002
mock_sre_config_from_remote, # noqa: ARG002
mock_graph_api_get_application_by_name, # noqa: ARG002
mock_sre_project_manager_deploy_then_exit, # noqa: ARG002
):
result = runner.invoke(sre_command_group, ["deploy", "sandbox"])
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
def pytest_configure(config):
"""Define constants for use across multiple tests"""
config.guid_admin = "00edec65-b071-4d26-8779-a9fe791c6e14"
config.guid_application = "aa78dceb-4116-4713-8554-cf2b3027e119"
config.guid_entra = "48b2425b-5f2c-4cbd-9458-0441daa8994c"
config.guid_subscription = "35ebced1-4e7a-4c1f-b634-c0886937085d"
config.guid_tenant = "d5c5c439-1115-4cb6-ab50-b8e547b6c8dd"
Expand Down

0 comments on commit 7a21be5

Please sign in to comment.