mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
config: read merged config by default (#5179)
* config: read merged config by default * tests: move root test out of config tests * tests: refactor config tests * cli: fix cache dir command
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import stat
|
||||
import textwrap
|
||||
|
||||
import configobj
|
||||
import pytest
|
||||
@@ -213,3 +214,27 @@ def test_shared_cache(tmp_dir, dvc, group, dir_mode):
|
||||
for fname in fnames:
|
||||
path = os.path.join(root, fname)
|
||||
assert stat.S_IMODE(os.stat(path).st_mode) == 0o444
|
||||
|
||||
|
||||
def test_cache_dir_local(tmp_dir, dvc, caplog):
|
||||
(tmp_dir / ".dvc" / "config.local").write_text(
|
||||
textwrap.dedent(
|
||||
"""\
|
||||
[cache]
|
||||
dir = some/path
|
||||
"""
|
||||
)
|
||||
)
|
||||
path = os.path.join(dvc.dvc_dir, "some", "path")
|
||||
|
||||
caplog.clear()
|
||||
assert main(["cache", "dir", "--local"]) == 0
|
||||
assert path in caplog.text
|
||||
|
||||
caplog.clear()
|
||||
assert main(["cache", "dir"]) == 0
|
||||
assert path in caplog.text
|
||||
|
||||
caplog.clear()
|
||||
assert main(["cache", "dir", "--repo"]) == 251
|
||||
assert "option 'dir' doesn't exist in section 'cache'" in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user