style: yapf format legacy cache reuse helpers

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
suluyan
2026-07-22 16:50:21 +08:00
parent 7e9a2e67aa
commit 9af78ca1fa
2 changed files with 4 additions and 3 deletions

View File

@@ -251,8 +251,8 @@ def find_reusable_legacy_repo_dir(
]
for path in legacy_candidates:
if _non_empty_dir(path):
logger.info(
'Found legacy cache at %s for %s, reusing.', path, repo_id)
logger.info('Found legacy cache at %s for %s, reusing.', path,
repo_id)
return str(path)
return None

View File

@@ -75,7 +75,8 @@ class LegacyCacheReuseTest(unittest.TestCase):
def test_uses_modelscope_cache_env(self):
legacy = self.cache / self.owner / self.name
self._touch_model_dir(legacy)
with mock.patch.dict(os.environ, {'MODELSCOPE_CACHE': str(self.cache)}):
with mock.patch.dict(os.environ,
{'MODELSCOPE_CACHE': str(self.cache)}):
found = find_reusable_legacy_repo_dir(self.model_id)
self.assertEqual(found, str(legacy))