Skip to content

Commit 317e999

Browse files
committed
Use generated hash instead of hard coded one.
1 parent ccd4be9 commit 317e999

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

datajoint/external.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,8 @@ def delete(self, *, delete_external_files=None, limit=None, display_progress=Tru
347347
try:
348348
self._remove_external_file(external_path)
349349
except Exception as error:
350-
if errors_as_string:
351-
error = str(error)
352-
error_list.append((uuid, external_path, error))
350+
error_list.append((uuid, external_path,
351+
str(error) if errors_as_string else error))
353352
return error_list
354353

355354

tests/test_s3.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from .schema_external import schema, SimpleRemote
88
from datajoint.errors import DataJointError
99
import os
10+
from datajoint.hash import uuid_from_buffer
11+
from datajoint.blob import pack
1012

1113

1214
class TestS3:
@@ -126,12 +128,12 @@ def test_remove_object_exception():
126128
errors_as_string=False)
127129

128130
# Teardown
129-
print(error_list[0][0])
130131
os.system('mc admin policy remove myminio test')
131132
os.system('mc admin user remove myminio jeffjeff')
132133
schema.external['share'].s3.client = old_client
133134
schema.external['share'].delete(delete_external_files=True)
134135
os.remove("/tmp/policy.json")
136+
135137
# Raise the error we want if the error matches the expected uuid
136-
if str(error_list[0][0]) == '4c16e9e1-5b64-474e-4b56-ba22bb17faae':
138+
if str(error_list[0][0]) == str(uuid_from_buffer(pack(test[1]))):
137139
raise error_list[0][2]

0 commit comments

Comments
 (0)