File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments