Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 73f14f0

Browse filesBrowse files
committed
tests(config_object): Stub out config object tests
1 parent 96c8bf8 commit 73f14f0
Copy full SHA for 73f14f0

File tree

Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+36
-0
lines changed

‎tests/test_config_object.py

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import pathlib
2+
3+
import pytest
4+
5+
from vcspull import config as config_tools
6+
7+
8+
@pytest.fixture
9+
def load_yaml(tmp_path: pathlib.Path):
10+
def fn(content, dir="randomdir", filename="randomfilename.yaml") -> pathlib.Path:
11+
_dir = tmp_path / dir
12+
_dir.mkdir()
13+
_config = _dir / filename
14+
_config.write_text(content, encoding="utf-8")
15+
16+
return _config
17+
18+
return fn
19+
20+
21+
def test_simple_format(load_yaml):
22+
config_file = load_yaml(
23+
"""
24+
vcspull:
25+
libvcs: git+https://github.com/vcs-python/libvcs
26+
"""
27+
)
28+
29+
config = config_tools.Config.from_yaml_file(config_file)
30+
31+
assert len(config.repos) == 1
32+
repo = config.repos[0]
33+
dir = repo.dir.parent.parent
34+
35+
assert dir / "vcspull" == repo.dir.parent
36+
assert dir / "vcspull" / "libvcs" == repo.dir

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.