-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples(tests): Align examples plugin tests
- Loading branch information
1 parent
4e3d7d4
commit b5fcb23
Showing
9 changed files
with
59 additions
and
77 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
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
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
22 changes: 14 additions & 8 deletions
22
provisioner_examples_plugin/provisioner_examples_plugin/config/domain/config_fakes.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import yaml | ||
from provisioner_examples_plugin.config.domain.config import ExamplesConfig | ||
from provisioner_features_lib.remote.typer_remote_opts_fakes import TEST_REMOTE_CFG_YAML_TEXT | ||
|
||
TEST_DATA_HELLO_WORLD_USERNAME = "test-username" | ||
|
||
class TestDataExamplesConfig: | ||
TEST_DATA_HELLO_WORLD_USERNAME = "test-username" | ||
TEST_DATA_YAML_TEXT = f""" | ||
hello_world: | ||
username: {TEST_DATA_HELLO_WORLD_USERNAME} | ||
""" | ||
|
||
class TestDataExamplesConfig: | ||
|
||
@staticmethod | ||
def create_fake_dummy_config() -> ExamplesConfig: | ||
return ExamplesConfig( | ||
hello_world=ExamplesConfig.HelloWorldConfig( | ||
username=TestDataExamplesConfig.TEST_DATA_HELLO_WORLD_USERNAME, | ||
) | ||
) | ||
def create_fake_example_config() -> ExamplesConfig: | ||
cfg_with_remote = TEST_DATA_YAML_TEXT + "\n" + TEST_REMOTE_CFG_YAML_TEXT | ||
cfg_dict = yaml.safe_load(cfg_with_remote) | ||
example_cfg = ExamplesConfig(cfg_dict) | ||
return example_cfg |
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
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