Skip to content

Commit

Permalink
Fix cli starters tests (#4052)
Browse files Browse the repository at this point in the history
* Fixed test_alias

Signed-off-by: Elena Khaustova <[email protected]>

* Fixed test_git_repo

Signed-off-by: Elena Khaustova <[email protected]>

* Fixed test_git_repo_custom_directory

Signed-off-by: Elena Khaustova <[email protected]>

---------

Signed-off-by: Elena Khaustova <[email protected]>
  • Loading branch information
ElenaKhaustova authored Aug 1, 2024
1 parent 78594be commit 276d423
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/framework/cli/test_starters.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,11 @@ def test_alias(self, fake_kedro_cli, mock_determine_repo_dir, mock_cookiecutter)
)
kwargs = {
"template": "git+https://github.com/kedro-org/kedro-starters.git",
"checkout": version,
"directory": "spaceflights-pandas",
}
starters_version = mock_determine_repo_dir.call_args[1].pop("checkout", None)

assert starters_version in [version, "main"]
assert kwargs.items() <= mock_determine_repo_dir.call_args[1].items()
assert kwargs.items() <= mock_cookiecutter.call_args[1].items()

Expand All @@ -853,11 +855,14 @@ def test_git_repo(self, fake_kedro_cli, mock_determine_repo_dir, mock_cookiecutt
["new", "--starter", "git+https://github.com/fake/fake.git"],
input=_make_cli_prompt_input(),
)

kwargs = {
"template": "git+https://github.com/fake/fake.git",
"checkout": version,
"directory": None,
}
starters_version = mock_determine_repo_dir.call_args[1].pop("checkout", None)

assert starters_version in [version, "main"]
assert kwargs.items() <= mock_determine_repo_dir.call_args[1].items()
del kwargs["directory"]
assert kwargs.items() <= mock_cookiecutter.call_args[1].items()
Expand Down Expand Up @@ -899,11 +904,14 @@ def test_git_repo_custom_directory(
],
input=_make_cli_prompt_input(),
)

kwargs = {
"template": "git+https://github.com/fake/fake.git",
"checkout": version,
"directory": "my_directory",
}
starters_version = mock_determine_repo_dir.call_args[1].pop("checkout", None)

assert starters_version in [version, "main"]
assert kwargs.items() <= mock_determine_repo_dir.call_args[1].items()
assert kwargs.items() <= mock_cookiecutter.call_args[1].items()

Expand Down

0 comments on commit 276d423

Please sign in to comment.