-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from .admin import admin_command_group | ||
from .context import context_command_group | ||
from .deploy import deploy_command_group | ||
from .init import initialise_command | ||
from .teardown import teardown_command_group | ||
|
||
__all__ = [ | ||
"admin_command_group", | ||
"context_command_group", | ||
"deploy_command_group", | ||
"initialise_command", | ||
"teardown_command_group", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from .config import Config | ||
from .context_settings import ContextSettings | ||
|
||
__all__ = [ | ||
"Config", | ||
"ContextSettings", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from data_safe_haven.commands.context import context_command_group | ||
|
||
from pytest import fixture | ||
from typer.testing import CliRunner | ||
|
||
context_settings = """\ | ||
selected: acme_deployment | ||
contexts: | ||
acme_deployment: | ||
name: Acme Deployment | ||
admin_group_id: d5c5c439-1115-4cb6-ab50-b8e547b6c8dd | ||
location: uksouth | ||
subscription_name: Data Safe Haven (Acme) | ||
gems: | ||
name: Gems | ||
admin_group_id: d5c5c439-1115-4cb6-ab50-b8e547b6c8dd | ||
location: uksouth | ||
subscription_name: Data Safe Haven (Gems)""" | ||
|
||
|
||
@fixture | ||
def tmp_contexts(tmp_path): | ||
config_file_path = tmp_path / "contexts.yaml" | ||
with open(config_file_path, "w") as f: | ||
f.write(context_settings) | ||
return config_file_path | ||
|
||
|
||
@fixture | ||
def runner(tmp_contexts): | ||
runner = CliRunner(env={ | ||
"DSH_CONFIG_DIRECTORY": str(tmp_contexts) | ||
}) | ||
return runner | ||
|
||
|
||
class TestShow: | ||
def test_show(self, runner): | ||
result = runner.invoke(context_command_group, ["show"]) | ||
assert result.exit_code == 0 |
2 changes: 1 addition & 1 deletion
2
tests_/config/test_backend_settings.py → tests_/config/test_context_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters