Skip to content

Commit e026979

Browse files
committed
Revert "PNE-241: Taking into consideration that material histories endpoint now returns a list of one"
This reverts commit c419c59.
1 parent c419c59 commit e026979

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/citrine/resources/material_run.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ def get_history(self, id: Union[str, UUID, LinkByUID, MaterialRun]) -> MaterialR
140140
}
141141
data = self.session.post_resource(path, json=query)
142142

143-
# The query returns a list of material runs, but we only expect one
144-
return MaterialRun.build(data[0])
143+
return MaterialRun.build(data)
145144

146145
def get_by_process(self,
147146
uid: Union[UUID, str, LinkByUID, GEMDProcessRun]

tests/resources/test_material_run.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ def test_get_history(collection, session):
116116
cake_json['root'] = next(o for o in cake_json['context'] if root_link.id == o['uids'].get(root_link.scope))
117117
cake_json['context'].remove(cake_json['root'])
118118

119-
# The query returns a list of material runs, but we only expect one
120-
session.set_response([cake_json])
119+
session.set_response(cake_json)
121120

122121
# When
123122
run = collection.get_history(id=root_link)

0 commit comments

Comments
 (0)