(opts)
| 242 | |
| 243 | |
| 244 | def _test_lock(opts): |
| 245 | g = _get_gitfs( |
| 246 | opts, |
| 247 | "https://github.com/saltstack/salt-test-pillar-gitfs.git", |
| 248 | ) |
| 249 | g.fetch_remotes() |
| 250 | assert len(g.remotes) == 1 |
| 251 | repo = g.remotes[0] |
| 252 | mach_id = _get_machine_identifier().get("machine_id", "no_machine_id_available") |
| 253 | assert repo.get_salt_working_dir() in repo._get_lock_file() |
| 254 | assert repo.lock() == ( |
| 255 | [ |
| 256 | ( |
| 257 | f"Set update lock for gitfs remote " |
| 258 | f"'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" |
| 259 | ) |
| 260 | ], |
| 261 | [], |
| 262 | ) |
| 263 | assert os.path.isfile(repo._get_lock_file()) |
| 264 | assert repo.clear_lock() == ( |
| 265 | [ |
| 266 | ( |
| 267 | f"Removed update lock for gitfs remote " |
| 268 | f"'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" |
| 269 | ) |
| 270 | ], |
| 271 | [], |
| 272 | ) |
| 273 | assert not os.path.isfile(repo._get_lock_file()) |
| 274 | |
| 275 | |
| 276 | @skipif_no_gitpython |
no test coverage detected