Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
(#1017) Add reading back robot load ispyb deposition to system test
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Apr 5, 2024
1 parent 7f5caf3 commit a30e5f7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/system_tests/external_interaction/test_exp_eye_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from time import sleep

import pytest
from requests import get

from hyperion.external_interaction.ispyb.exp_eye_store import ExpeyeInteraction
from hyperion.parameters.constants import CONST
Expand All @@ -11,17 +12,30 @@
def test_start_and_end_robot_load():
os.environ["ISPYB_CONFIG_PATH"] = CONST.SIM.DEV_ISPYB_DATABASE_CFG

SAMPLE_ID = 5289780
BARCODE = "test_barcode"

expeye = ExpeyeInteraction()

robot_action_id = expeye.start_load("cm37235", 2, 5289780, 40, 3)
robot_action_id = expeye.start_load("cm37235", 2, SAMPLE_ID, 40, 3)

sleep(0.5)

expeye.update_barcode(robot_action_id, "test_barcode")
print(f"Created {robot_action_id}")

expeye.update_barcode(robot_action_id, BARCODE)

sleep(0.5)

expeye.end_load(robot_action_id, "fail", "Oh no!")

# There is currently no way to get robot load info using expeye so to confirm for
# now manually check https://ispyb-test.diamond.ac.uk/dc/visit/cm37235-2
get_robot_data_url = f"{expeye.base_url}/robot-actions/{robot_action_id}"
response = get(get_robot_data_url, auth=expeye.auth)

assert response.ok

response = response.json()
assert response["robotActionId"] == robot_action_id
assert response["status"] == "ERROR"
assert response["sampleId"] == SAMPLE_ID
assert response["sampleBarcode"] == BARCODE

0 comments on commit a30e5f7

Please sign in to comment.