test + lib: Fix miscellanous bugs and inconsistencies #46

Merged
Jan Lindemann merged 8 commits from jan/feature/20260704-test-fix-test-py-duplicate-module-name-error into master 2026-07-04 07:46:09 +02:00 AGit
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 62803a4a1b - Show all commits

lib.Uri: Return 'file' scheme for local paths

The scheme property returns 'file://' for local paths instead of 'file', causing scheme_plus_authority to produce 'file://://' with a triple slash.

Also fix the test to expect 'file' instead of 'file://'.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-07-01 16:03:24 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -63,7 +63,7 @@ class Uri:
def scheme(self) -> str:
ret = self.__p.scheme
if not ret:
return 'file://'
return 'file'
return ret
@cached_property

View file

@ -19,7 +19,7 @@ assert '<hidden>' in u.safe_full_with_username # safe version hides password
# Scheme defaults to file
u = Uri('/local/path')
assert u.scheme == 'file://'
assert u.scheme == 'file'
assert u.protocol == 'file'
# Pimp returns existing Uri unchanged