[PR jw/#169] lib.util.copy(): Require recursive for directories
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:
commit
bed3e90169
1 changed files with 19 additions and 1 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue