[PR jw/#169] lib.util.copy(): Require recursive for directories
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m49s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 5m0s
CI / Packaging test (push) Successful in 0s

Merge pull request "lib.util.copy(): Require recursive for directories"

Upstream-repo: ssh://git@code.janware.com/janware/jw-pkg
Source-branch: jan/feature/20261107-lib-util-copy-require-recursive-for-directories
Target-branch: master
Reviewed-on: #169
This commit is contained in:
Jan Lindemann 2026-11-07 14:35:41 +01:00 • committed by janware Code
commit bed3e90169
Signed by: Code Bot
GPG key ID: 66A5D2B295EE1224

View file

@ -174,6 +174,18 @@ async def run_tests() -> None:
except Exception:
pass
# -- A directory without recursive fails with a clear error,
# for a plain context and for a kvfile store alike
for src in [
uri(os.path.join(tmp, 'src/a')),
f'kvfile:///{tmp}/src/a',
]:
try:
await copy(src, uri(os.path.join(tmp, 'dst/dir-copy')))
raise AssertionError('expected an exception')
except Exception as e:
assert 'recursive' in str(e), e
def main() -> None:
asyncio.run(run_tests())
print('All util copy tests passed')