@@ -16,7 +16,7 @@ class LoadYAMLFn(t.Protocol):
16
16
def __call__ (
17
17
self ,
18
18
content : str ,
19
- dir : str = "randomdir" ,
19
+ path : str = "randomdir" ,
20
20
filename : str = "randomfilename.yaml" ,
21
21
) -> tuple [pathlib .Path , list [t .Union [t .Any , pathlib .Path ]], list ["ConfigDict" ]]:
22
22
"""Callable function type signature for load_yaml pytest fixture."""
@@ -28,10 +28,10 @@ def load_yaml(tmp_path: pathlib.Path) -> LoadYAMLFn:
28
28
"""Return a yaml loading function that uses temporary directory path."""
29
29
30
30
def fn (
31
- content : str , dir : str = "randomdir" , filename : str = "randomfilename.yaml"
31
+ content : str , path : str = "randomdir" , filename : str = "randomfilename.yaml"
32
32
) -> tuple [pathlib .Path , list [pathlib .Path ], list ["ConfigDict" ]]:
33
33
"""Return vcspull configurations and write out config to temp directory."""
34
- _dir = tmp_path / dir
34
+ _dir = tmp_path / path
35
35
_dir .mkdir ()
36
36
_config = _dir / filename
37
37
_config .write_text (content , encoding = "utf-8" )
@@ -45,7 +45,7 @@ def fn(
45
45
46
46
def test_simple_format (load_yaml : LoadYAMLFn ) -> None :
47
47
"""Test simple configuration YAML file for vcspull."""
48
- dir , _ , repos = load_yaml (
48
+ path , _ , repos = load_yaml (
49
49
"""
50
50
vcspull:
51
51
libvcs: git+https://github.com/vcs-python/libvcs
@@ -55,24 +55,24 @@ def test_simple_format(load_yaml: LoadYAMLFn) -> None:
55
55
assert len (repos ) == 1
56
56
repo = repos [0 ]
57
57
58
- assert dir / "vcspull" == repo ["dir " ].parent
59
- assert dir / "vcspull" / "libvcs" == repo ["dir " ]
58
+ assert path / "vcspull" == repo ["path " ].parent
59
+ assert path / "vcspull" / "libvcs" == repo ["path " ]
60
60
61
61
62
62
def test_relative_dir (load_yaml : LoadYAMLFn ) -> None :
63
63
"""Test configuration files for vcspull support relative directories."""
64
- dir , _ , repos = load_yaml (
64
+ path , _ , repos = load_yaml (
65
65
"""
66
66
./relativedir:
67
67
docutils: svn+http://svn.code.sf.net/p/docutils/code/trunk
68
68
"""
69
69
)
70
70
71
- config_files = config .find_config_files (path = dir )
72
- repos = config .load_configs (config_files , dir )
71
+ config_files = config .find_config_files (path = path )
72
+ repos = config .load_configs (config_files , path )
73
73
74
74
assert len (repos ) == 1
75
75
repo = repos [0 ]
76
76
77
- assert dir / "relativedir" == repo ["dir " ].parent
78
- assert dir / "relativedir" / "docutils" == repo ["dir " ]
77
+ assert path / "relativedir" == repo ["path " ].parent
78
+ assert path / "relativedir" / "docutils" == repo ["path " ]
0 commit comments