-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create empty group when nothing selected
- Loading branch information
1 parent
4195dda
commit 8460d39
Showing
3 changed files
with
29 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,31 @@ | |
|
||
|
||
@pytest.mark.parametrize( | ||
"model_yml,start_group_yml,end_group_yml", | ||
"model_yml,select,start_group_yml,end_group_yml", | ||
[ | ||
(model_yml_shared_model, group_yml_empty_file, expected_group_yml_no_group), | ||
(model_yml_shared_model, group_yml_existing_groups, expected_group_yml_existing_groups), | ||
(model_yml_shared_model, group_yml_group_predefined, expected_group_yml_no_group), | ||
( | ||
model_yml_shared_model, | ||
"shared_model", | ||
group_yml_empty_file, | ||
expected_group_yml_no_group, | ||
), | ||
( | ||
model_yml_shared_model, | ||
"shared_model", | ||
group_yml_existing_groups, | ||
expected_group_yml_existing_groups, | ||
), | ||
( | ||
model_yml_shared_model, | ||
"shared_model", | ||
group_yml_group_predefined, | ||
expected_group_yml_no_group, | ||
), | ||
(model_yml_shared_model, "", group_yml_empty_file, expected_group_yml_no_group), | ||
], | ||
ids=["1", "2", "3"], | ||
ids=["1", "2", "3", "4"], | ||
) | ||
def test_create_group_command(model_yml, start_group_yml, end_group_yml): | ||
def test_create_group_command(model_yml, select, start_group_yml, end_group_yml): | ||
group_yml_file = proj_path / "models" / "_groups.yml" | ||
model_yml_file = proj_path / "models" / "_models.yml" | ||
|
||
|
@@ -48,7 +64,7 @@ def test_create_group_command(model_yml, start_group_yml, end_group_yml): | |
[ | ||
"test_group", | ||
"--select", | ||
"shared_model", | ||
select, | ||
"--project-path", | ||
proj_path_string, | ||
"--owner-name", | ||
|
@@ -68,25 +84,6 @@ def test_create_group_command(model_yml, start_group_yml, end_group_yml): | |
assert actual == yaml.safe_load(end_group_yml) | ||
|
||
|
||
def test_group_command_no_selection_syntax(): | ||
"""Test that the command fails if no selection syntax is provided""" | ||
runner = CliRunner() | ||
result = runner.invoke( | ||
create_group, | ||
[ | ||
"test_group", | ||
"--project-path", | ||
proj_path_string, | ||
"--owner-name", | ||
"Shaina Fake", | ||
"--owner-email", | ||
"[email protected]", | ||
], | ||
) | ||
|
||
assert result.exit_code == 1 | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name,email,end_group_yml", | ||
[ | ||
|