forked from iterative/dvc
-
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.
Implement dvc config --list (iterative#5080)
* Implement dvc config --list * Add test for successful CLI exit on --list * Use dvc.utils.flatten, remove parser groups * Move the test
- Loading branch information
1 parent
96a97ec
commit d3acbfe
Showing
4 changed files
with
70 additions
and
1 deletion.
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,20 @@ | ||
from dvc.command.config import CmdConfig | ||
|
||
|
||
def test_config_formatter(): | ||
example_config = { | ||
"section_foo": {"option_bar": True, "option_baz": False}, | ||
"section_foo2": { | ||
"option_bar2": {"option_baz2": True}, | ||
"option_baz3": {"option_baz4": False}, | ||
}, | ||
"section_foo3": {}, | ||
} | ||
|
||
config_lines = tuple(CmdConfig._format_config(example_config)) | ||
assert config_lines == ( | ||
"section_foo.option_bar=True", | ||
"section_foo.option_baz=False", | ||
"section_foo2.option_bar2.option_baz2=True", | ||
"section_foo2.option_baz3.option_baz4=False", | ||
) |