|
1 | 1 | import os
|
2 | 2 | import string
|
3 |
| -from time import time |
| 3 | +import time |
4 | 4 |
|
5 | 5 | import pytest
|
6 | 6 | import salt.config
|
@@ -70,14 +70,6 @@ def test_provider_case_insensitive_gitfs_provider(minion_opts, role_name, role_c
|
70 | 70 | # Now try to instantiate an instance with all lowercase
|
71 | 71 | # letters. Again, no need for an assert here.
|
72 | 72 | role_class(*args, **kwargs)
|
73 |
| - pytest.mark.parametrize( |
74 |
| - "role_name,role_class", |
75 |
| - ( |
76 |
| - ("gitfs", salt.utils.gitfs.GitFS), |
77 |
| - ("git_pillar", salt.utils.gitfs.GitPillar), |
78 |
| - ("winrepo", salt.utils.gitfs.WinRepo), |
79 |
| - ), |
80 |
| - ) |
81 | 73 |
|
82 | 74 |
|
83 | 75 | @pytest.mark.parametrize(
|
@@ -126,7 +118,9 @@ def _prepare_remote_repository_pygit2(tmp_path):
|
126 | 118 | remote = os.path.join(tmp_path, "pygit2-repo")
|
127 | 119 | filecontent = "This is an empty README file"
|
128 | 120 | filename = "README"
|
129 |
| - signature = pygit2.Signature("Dummy Commiter", "dummy@dummy.com", int(time()), 0) |
| 121 | + signature = pygit2.Signature( |
| 122 | + "Dummy Commiter", "dummy@dummy.com", int(time.time()), 0 |
| 123 | + ) |
130 | 124 | repository = pygit2.init_repository(remote, False)
|
131 | 125 | builder = repository.TreeBuilder()
|
132 | 126 | tree = builder.write()
|
@@ -161,10 +155,10 @@ def _prepare_remote_repository_pygit2(tmp_path):
|
161 | 155 |
|
162 | 156 | @pytest.fixture
|
163 | 157 | def _prepare_provider(tmp_path, minion_opts, _prepare_remote_repository_pygit2):
|
164 |
| - cache = os.path.join(tmp_path, "pygit2-repo-cache") |
| 158 | + cache = tmp_path / "pygit2-repo-cache" |
165 | 159 | minion_opts.update(
|
166 | 160 | {
|
167 |
| - "cachedir": cache, |
| 161 | + "cachedir": str(cache), |
168 | 162 | "gitfs_disable_saltenv_mapping": False,
|
169 | 163 | "gitfs_base": "master",
|
170 | 164 | "gitfs_insecure_auth": False,
|
@@ -210,16 +204,16 @@ def _prepare_provider(tmp_path, minion_opts, _prepare_remote_repository_pygit2):
|
210 | 204 | "user": "",
|
211 | 205 | }
|
212 | 206 | per_remote_only = ("all_saltenvs", "name", "saltenv")
|
213 |
| - override_params = tuple(per_remote_defaults.keys()) |
214 |
| - cache_root = os.path.join(cache, "gitfs") |
| 207 | + override_params = tuple(per_remote_defaults) |
| 208 | + cache_root = cache / "gitfs" |
215 | 209 | role = "gitfs"
|
216 | 210 | provider = salt.utils.gitfs.Pygit2(
|
217 | 211 | minion_opts,
|
218 | 212 | _prepare_remote_repository_pygit2,
|
219 | 213 | per_remote_defaults,
|
220 | 214 | per_remote_only,
|
221 | 215 | override_params,
|
222 |
| - cache_root, |
| 216 | + str(cache_root), |
223 | 217 | role,
|
224 | 218 | )
|
225 | 219 | return provider
|
|
0 commit comments