cloner.detector_enabled

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
2022-08-03 07:02:49 +02:00
parent ff1e90982a
commit 52c3d03e2f
2 changed files with 15 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ class MockDirStruct:
def __init__(self, tmp: Path):
self.config = MockConfig()
self.cache_dir = tmp.joinpath("cache")
self.config_dir = tmp.joinpath("config")
self.conf_dir = tmp.joinpath("config")
self.repos_dir = tmp.joinpath("repos")
self.raise_cache_exists = False
@@ -457,3 +457,12 @@ def test_clone_recursive(tmp_path, path_repo_base, caplog):
assert cloner.clone()
patch_clone_recursive.assert_called_with(
'https://repo', tmp_path.joinpath('cache', 'submodules').as_posix(), scan_depth = None)
def test_detector_enabled(cloner_dir_with_config):
ds = MockDirStruct(cloner_dir_with_config)
ds.config.cloner_repo_url = "http://mock"
cl = Cloner(ds)
assert not cl.detector_enabled
Path(cloner_dir_with_config).joinpath("config", "detector.cfg").touch()
assert cl.detector_enabled