Skip to content

Commit fc26d15

Browse files
Paul Hewletteccles
authored andcommitted
Func test for attachment info
Problem: No method of getting the attachment info for a particular attachment identity. Solution: A func test 'test_attachment_info' was added that used an environment variable TEST_BLOB_IDENTITY' to get the attachment info for a particular blob. Signed-off-by: Paul Hewlett <[email protected]>
1 parent ab3fe2e commit fc26d15

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

functests/execassets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def setUp(self):
7979
client_secret_filename=getenv("TEST_CLIENT_SECRET_FILENAME"),
8080
)
8181
self.arch = Archivist(
82-
getenv("TEST_ARCHIVIST"), auth, verify=False, max_time=300
82+
getenv("TEST_ARCHIVIST"), auth, verify=False, max_time=600
8383
)
8484
self.attrs = deepcopy(ATTRS)
8585
self.traffic_light = deepcopy(ATTRS)
@@ -244,7 +244,7 @@ def setUp(self):
244244
client_secret_filename=getenv("TEST_CLIENT_SECRET_FILENAME"),
245245
)
246246
self.arch = Archivist(
247-
getenv("TEST_ARCHIVIST"), auth, verify=False, max_time=300
247+
getenv("TEST_ARCHIVIST"), auth, verify=False, max_time=600
248248
)
249249

250250
def tearDown(self):

functests/execattachments.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from json import dumps as json_dumps
77
from io import BytesIO
88
from os import getenv, remove
9-
from unittest import TestCase
9+
from unittest import TestCase, skipIf
1010

1111
from archivist.archivist import Archivist
1212
from archivist.errors import ArchivistBadRequestError
@@ -109,6 +109,19 @@ def test_attachment_upload_and_download_docx(self):
109109
msg="UPLOAD incorrect mimetype",
110110
)
111111

112+
@skipIf(
113+
getenv("TEST_BLOB_IDENTITY") is None,
114+
"cannot run test as TEST_BLOB_IDENTITY is not set",
115+
)
116+
def test_attachment_info(self):
117+
"""
118+
Test file info through the SDK
119+
Test file download through the SDK
120+
"""
121+
file_uuid = getenv("TEST_BLOB_IDENTITY")
122+
info = self.arch.attachments.info(file_uuid)
123+
print("attachment info", json_dumps(info, indent=4))
124+
112125
def test_attachment_upload_and_download_allow_insecure(self):
113126
"""
114127
Test file upload through the SDK

functests/execpublicassets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def setUp(self):
8181
client_secret_filename=getenv("TEST_CLIENT_SECRET_FILENAME"),
8282
)
8383
self.url = getenv("TEST_ARCHIVIST")
84-
self.arch = Archivist(self.url, auth, verify=False, max_time=300)
84+
self.arch = Archivist(self.url, auth, verify=False, max_time=600)
8585
self.attrs = deepcopy(ATTRS)
8686
self.traffic_light = deepcopy(ATTRS)
8787
self.traffic_light["arc_display_type"] = "Traffic light with violation camera"

scripts/builder.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ docker run \
2424
-e TEST_AUTHTOKEN \
2525
-e TEST_AUTHTOKEN_FILENAME \
2626
-e TEST_AUTHTOKEN_FILENAME_2 \
27+
-e TEST_BLOB_IDENTITY \
2728
-e TEST_CLIENT_ID \
2829
-e TEST_CLIENT_SECRET \
2930
-e TEST_CLIENT_SECRET_FILENAME \

0 commit comments

Comments
 (0)