-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{release,config}.py: consistently treat --{only,exclude}
fixes #35
- Loading branch information
Showing
4 changed files
with
40 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
|
||
from click.exceptions import BadArgumentUsage | ||
import pytest | ||
|
||
from orchestra.config import read_conf | ||
|
||
|
||
@pytest.mark.parametrize("pkg", ["sa-bar", "sa-foo"]) | ||
def test_read_conf(pkg): | ||
conf_file = Path(__file__).parent / "scm.toml" | ||
|
||
conf = read_conf(f"{conf_file}", only=[pkg]) | ||
assert list(conf["repos"]) == [pkg] | ||
assert list(conf["branches"]) == [pkg] | ||
|
||
conf = read_conf(f"{conf_file}", exclude=[pkg]) | ||
assert pkg not in list(conf["repos"]) | ||
assert pkg not in list(conf["branches"]) | ||
|
||
with pytest.raises(BadArgumentUsage, match="mutually exclusive"): | ||
read_conf(f"{conf_file}", only=[pkg], exclude=[pkg]) |