Skip to content

Commit

Permalink
Add test for --show-config output.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstegeman committed Dec 30, 2020
1 parent d7238e9 commit 87155e7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/func/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,28 @@ def test_config_remote(tmp_dir, dvc, caplog):
caplog.clear()
assert main(["config", "remote.myremote.region"]) == 0
assert "myregion" in caplog.text


def test_config_list(tmp_dir, dvc, caplog):
(tmp_dir / ".dvc" / "config").write_text(
"['remote \"myremote\"']\n"
" url = s3://bucket/path\n"
" region = myregion\n"
)

caplog.clear()
assert main(["config", "--show-origin", "remote.myremote.url"]) == 0
assert (
"{}\t{}\n".format(os.path.join(".dvc", "config"), "s3://bucket/path")
in caplog.text
)

caplog.clear()
assert main(["config", "--list", "--show-origin"]) == 0
assert (
"{}\t{}\n".format(
os.path.join(".dvc", "config"),
"remote.myremote.url=s3://bucket/path",
)
in caplog.text
)

0 comments on commit 87155e7

Please sign in to comment.