-
Notifications
You must be signed in to change notification settings - Fork 715
Closed
Labels
Description
Describe the bug
write_with_if_not_exists capability is enabled on azblob service but it seems that when an object is written with if_not_exists option, the operation breaks
Steps to Reproduce
@pytest.mark.need_capability("write", "delete", "write_with_if_not_exists")
def test_sync_writer_options(service_name, operator, async_operator):
size = randint(1, 1024)
filename = f"test_file_{str(uuid4())}.txt"
content = os.urandom(size)
f = operator.open(filename, "wb")
written_bytes = f.write(content)
assert written_bytes == size
f.close()
with pytest.raises(ConditionNotMatch):
with operator.open(filename, "wb", if_not_exists=True) as w:
w.write(content)Expected Behavior
if the file exists error should be thrown as expected.
Additional Context
No response
Are you willing to submit a PR to fix this bug?
- Yes, I would like to submit a PR.
Reactions are currently unavailable