[#201] Execute command object head --raw and check object deletion

Execute command object head --raw and check object deletion

Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com
Mikhail Kadilov 2024-02-28 01:19:24 +03:00
parent f01b886a7e
commit 11dd0140f1
1 changed files with 8 additions and 6 deletions

View File

@ -225,14 +225,16 @@ class TestObjectApi(ClusterTestBase):
try:
result = head_object(wallet, cid, oid, shell, self.cluster.default_rpc_endpoint, is_raw=True)
if result.return_code != 0:
# Continue test execution because an error occurred (as expected)
print("Error occurred while executing head_object, continuing test execution.")
print("Expected error occurred while executing head_object, continuing test execution.")
else:
# Throw an exception because head_object completed without errors
raise AssertionError("head_object executed successfully without error.")
raise AssertionError("Unexpected successful execution of head_object.")
except Exception as e:
print(f"An error occurred: {e}")
raise
if "object already removed" in str(e):
print("Expected error occurred: object already removed")
else:
print(f"An unexpected error occurred: {e}")
raise
@allure.title("Search objects by native API (obj_size={object_size})")
def test_search_object_api(self, storage_objects: list[StorageObjectInfo]):