mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
test(proxy): cover the default writability check against the real filesystem
The other tests inject the writability check, so the default one that calls os.access was never run. Check it against a real temp directory and a missing one, which holds even when the tests run as root
This commit is contained in:
parent
e6bbf52aa6
commit
e57d0e692b
1 changed files with 11 additions and 0 deletions
|
|
@ -119,3 +119,14 @@ class TestPrismaMigration:
|
|||
prisma_migration.prisma_package_is_writable(find_spec=lambda _name: None, is_writable=lambda _path: True)
|
||||
is False
|
||||
)
|
||||
|
||||
def test_prisma_package_is_writable_checks_the_real_filesystem_by_default(self, tmp_path: Path) -> None:
|
||||
missing_dir: Path = tmp_path / "missing"
|
||||
|
||||
def spec_at(location: Path) -> ModuleSpec:
|
||||
spec = ModuleSpec("prisma", None, is_package=True)
|
||||
spec.submodule_search_locations = [str(location)]
|
||||
return spec
|
||||
|
||||
assert prisma_migration.prisma_package_is_writable(find_spec=lambda _name: spec_at(tmp_path)) is True
|
||||
assert prisma_migration.prisma_package_is_writable(find_spec=lambda _name: spec_at(missing_dir)) is False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue