Skip to content

Commit 87155e7

Browse files
committed
Add test for --show-config output.
1 parent d7238e9 commit 87155e7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/func/test_config.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,28 @@ def test_config_remote(tmp_dir, dvc, caplog):
186186
caplog.clear()
187187
assert main(["config", "remote.myremote.region"]) == 0
188188
assert "myregion" in caplog.text
189+
190+
191+
def test_config_list(tmp_dir, dvc, caplog):
192+
(tmp_dir / ".dvc" / "config").write_text(
193+
"['remote \"myremote\"']\n"
194+
" url = s3://bucket/path\n"
195+
" region = myregion\n"
196+
)
197+
198+
caplog.clear()
199+
assert main(["config", "--show-origin", "remote.myremote.url"]) == 0
200+
assert (
201+
"{}\t{}\n".format(os.path.join(".dvc", "config"), "s3://bucket/path")
202+
in caplog.text
203+
)
204+
205+
caplog.clear()
206+
assert main(["config", "--list", "--show-origin"]) == 0
207+
assert (
208+
"{}\t{}\n".format(
209+
os.path.join(".dvc", "config"),
210+
"remote.myremote.url=s3://bucket/path",
211+
)
212+
in caplog.text
213+
)

0 commit comments

Comments
 (0)