Zheaoli commented on code in PR #3563:
URL:
https://github.com/apache/incubator-opendal/pull/3563#discussion_r1390159561
##########
bindings/python/tests/test_async_copy.py:
##########
@@ -93,7 +94,7 @@ async def test_async_copy_nested(service_name, operator,
async_operator):
assert target_content is not None
assert target_content == content
await async_operator.delete(source_path)
- await async_operator.delete(target_path)
+ await async_operator.remove_all(f'{target_path.split("/")[0]}/')
Review Comment:
The core point is not about the directory issue. The `remove_all` action
needs the `list` capability`. Not all of the services support it.
For me, I prefer like this way
```python
@pytest.mark.need_capability("read", "write", "copy")
def test_sync_copy_nested(service_name, operator, async_operator):
source_path = f"random_file_{str(uuid4())}"
remove_index=[]
target_path = f"random_file_{str(uuid4())}"
for i in range(2):
target_path=target_path+f"/{str(uuid4())}"
remove_index.append(target_path)
content = os.urandom(1024)
operator.write(source_path, content)
operator.copy(source_path, target_path)
target_content = operator.read(target_path)
assert target_content is not None
assert target_content == content
operator.delete(source_path)
try:
for index in range(remove_index):
operator.delete(index)
except:
pass
```
We register all the path we used in index and remove it by using `remove` API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]