mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
import re
|
|
|
|
from dvc.main import main
|
|
|
|
|
|
def test_info_in_repo(dvc_repo, caplog):
|
|
assert main(["version"]) == 0
|
|
|
|
assert re.search(re.compile(r"DVC version: \d+\.\d+\.\d+"), caplog.text)
|
|
assert re.search(re.compile(r"Python version: \d\.\d\.\d"), caplog.text)
|
|
assert re.search(re.compile(r"Platform: .*"), caplog.text)
|
|
assert re.search(re.compile(r"Binary: (True|False)"), caplog.text)
|
|
assert re.search(
|
|
re.compile(r"Filesystem type \(cache directory\): .*"), caplog.text
|
|
)
|
|
assert re.search(
|
|
re.compile(r"Filesystem type \(workspace\): .*"), caplog.text
|
|
)
|
|
assert re.search(
|
|
re.compile(r"(Cache: (.*link - (True|False)(,\s)?){3})"), caplog.text
|
|
)
|
|
|
|
|
|
def test_info_outside_of_repo(repo_dir, caplog):
|
|
assert main(["version"]) == 0
|
|
|
|
assert re.search(re.compile(r"DVC version: \d+\.\d+\.\d+"), caplog.text)
|
|
assert re.search(re.compile(r"Python version: \d\.\d\.\d"), caplog.text)
|
|
assert re.search(re.compile(r"Platform: .*"), caplog.text)
|
|
assert re.search(re.compile(r"Binary: (True|False)"), caplog.text)
|
|
assert re.search(
|
|
re.compile(r"Filesystem type \(workspace\): .*"), caplog.text
|
|
)
|
|
assert not re.search(
|
|
re.compile(r"Filesystem type \(cache directory\): .*"), caplog.text
|
|
)
|
|
assert not re.search(
|
|
re.compile(r"(Cache: (.*link - (True|False)(,\s)?){3})"), caplog.text
|
|
)
|