Skip to content

Commit 31c23e7

Browse files
authored
Fix simple hash functest (#258)
Both the simple_hasgh and the merkle_log tests used the same asset signature which meant they were using the same asset for the test. Changing the signature then made the simple_hash test pass and the merkle_log fail as expected. Additionally fixed pylint error about using 'yield from' Fixes AB#9157
1 parent d30f394 commit 31c23e7

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

archivist/archivistpublic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ def list(
429429
except KeyError as ex:
430430
raise ArchivistBadFieldError(f"No {field} found") from ex
431431

432-
for record in records:
433-
yield record
432+
yield from records
434433

435434
page_token = data.get("next_page_token")
436435
if not page_token:

functests/execassets.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
"behaviours": ASSET_BEHAVIOURS,
4747
"proof_mechanism": ProofMechanism.SIMPLE_HASH.name,
4848
"attributes": {
49-
"arc_display_name": ASSET_NAME,
50-
"arc_namespace": getenv("DATATRAILS_UNIQUE_ID"),
51-
"arc_firmware_version": "1.0",
52-
"arc_serial_number": "vtl-x4-07",
5349
"arc_description": "Traffic flow control light at A603 North East",
50+
"arc_display_name": f"{ASSET_NAME} (SIMPLE_HASH)",
5451
"arc_display_type": "Traffic light with violation camera",
52+
"arc_firmware_version": "1.0",
53+
"arc_namespace": getenv("DATATRAILS_UNIQUE_ID"),
54+
"arc_serial_number": "vtl-x4-07",
5555
"some_custom_attribute": "value",
5656
},
5757
"attachments": [
@@ -79,12 +79,12 @@
7979
"behaviours": ASSET_BEHAVIOURS,
8080
"proof_mechanism": ProofMechanism.MERKLE_LOG.name,
8181
"attributes": {
82-
"arc_display_name": ASSET_NAME,
83-
"arc_namespace": getenv("DATATRAILS_UNIQUE_ID"),
84-
"arc_firmware_version": "1.0",
85-
"arc_serial_number": "vtl-x4-07",
8682
"arc_description": "Traffic flow control light at A603 North East",
83+
"arc_display_name": f"{ASSET_NAME} (MERKLE_LOG)",
8784
"arc_display_type": "Traffic light with violation camera",
85+
"arc_firmware_version": "1.0",
86+
"arc_namespace": getenv("DATATRAILS_UNIQUE_ID"),
87+
"arc_serial_number": "vtl-x4-07",
8888
"some_custom_attribute": "value",
8989
},
9090
"attachments": [
@@ -117,7 +117,7 @@ def setUp(self):
117117
client_secret=getenv("DATATRAILS_APPREG_SECRET"),
118118
client_secret_filename=getenv("DATATRAILS_APPREG_SECRET_FILENAME"),
119119
)
120-
self.arch = Archivist(getenv("DATATRAILS_URL"), auth, max_time=600)
120+
self.arch = Archivist(getenv("DATATRAILS_URL"), auth, max_time=30)
121121
self.attrs = deepcopy(ATTRS)
122122
self.traffic_light = deepcopy(ATTRS)
123123
self.traffic_light["arc_display_type"] = "Traffic light with violation camera"

unittests/testassetsconstants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ class TestAssetsBaseConfirm(TestCase):
529529
maxDiff = None
530530

531531
def setUp(self):
532-
self.arch = Archivist("url", "authauthauth", max_time=100)
532+
self.arch = Archivist("url", "authauthauth", max_time=30)
533533

534534
def tearDown(self):
535535
self.arch.close()

0 commit comments

Comments
 (0)