@@ -1075,13 +1075,6 @@ def test_ensure_location_not_occupied_raises(
1075
1075
)
1076
1076
1077
1077
1078
- @pytest .mark .parametrize (
1079
- argnames = ["location" , "expected_center_point" ],
1080
- argvalues = [
1081
- (DeckSlotLocation (slotName = DeckSlotName .SLOT_1 ), Point (101.0 , 102.0 , 203 )),
1082
- (ModuleLocation (moduleId = "module-id" ), Point (111.0 , 122.0 , 233 )),
1083
- ],
1084
- )
1085
1078
def test_get_labware_grip_point (
1086
1079
decoy : Decoy ,
1087
1080
labware_view : LabwareView ,
@@ -1096,20 +1089,6 @@ def test_get_labware_grip_point(
1096
1089
labware_view .get_grip_height_from_labware_bottom ("labware-id" )
1097
1090
).then_return (100 )
1098
1091
1099
- if isinstance (location , ModuleLocation ):
1100
- decoy .when (labware_view .get_deck_definition ()).then_return (
1101
- ot2_standard_deck_def
1102
- )
1103
- decoy .when (
1104
- module_view .get_module_offset (
1105
- module_id = "module-id" , deck_type = DeckType .OT2_STANDARD
1106
- )
1107
- ).then_return (LabwareOffsetVector (x = 10 , y = 20 , z = 30 ))
1108
-
1109
- decoy .when (module_view .get_location ("module-id" )).then_return (
1110
- DeckSlotLocation (slotName = DeckSlotName .SLOT_1 )
1111
- )
1112
-
1113
1092
decoy .when (labware_view .get_slot_center_position (DeckSlotName .SLOT_1 )).then_return (
1114
1093
Point (x = 101 , y = 102 , z = 103 )
1115
1094
)
@@ -1120,30 +1099,43 @@ def test_get_labware_grip_point(
1120
1099
assert labware_center == expected_center_point
1121
1100
1122
1101
1102
+ @pytest .mark .parametrize (
1103
+ argnames = ["location" , "expected_center_point" ],
1104
+ argvalues = [
1105
+ (OnLabwareLocation (labwareId = "labware-id" ), Point (5 , 10 , 115.0 )),
1106
+ (ModuleLocation (moduleId = "module-id" ), Point (111.0 , 122.0 , 233 )),
1107
+ ],
1108
+ )
1123
1109
def test_get_labware_grip_point_on_labware (
1124
1110
decoy : Decoy ,
1125
1111
labware_view : LabwareView ,
1126
1112
module_view : ModuleView ,
1127
1113
ot2_standard_deck_def : DeckDefinitionV3 ,
1128
1114
subject : GeometryView ,
1115
+ location : Union [ModuleLocation , OnLabwareLocation ],
1116
+ expected_center_point : Point ,
1129
1117
) -> None :
1130
1118
"""It should get the grip point of a labware on another labware."""
1131
- decoy .when (labware_view .get (labware_id = "labware-id" )).then_return (
1132
- LoadedLabware (
1133
- id = "labware-id" ,
1134
- loadName = "above-name" ,
1135
- definitionUri = "1234" ,
1136
- location = OnLabwareLocation (labwareId = "below-id" ),
1119
+ if isinstance (location , ModuleLocation ):
1120
+ decoy .when (module_view .get_location ("module-id" )).then_return (DeckSlotLocation (slotName = DeckSlotName .SLOT_4 ))
1121
+ else :
1122
+
1123
+ decoy .when (labware_view .get (labware_id = "labware-id" )).then_return (
1124
+ LoadedLabware (
1125
+ id = "labware-id" ,
1126
+ loadName = "above-name" ,
1127
+ definitionUri = "1234" ,
1128
+ location = OnLabwareLocation (labwareId = "below-id" ),
1129
+ )
1137
1130
)
1138
- )
1139
- decoy . when ( labware_view . get ( labware_id = "below-id" )). then_return (
1140
- LoadedLabware (
1141
- id = "below-id " ,
1142
- loadName = "below-name " ,
1143
- definitionUri = "1234" ,
1144
- location = DeckSlotLocation ( slotName = DeckSlotName . SLOT_4 ),
1131
+ decoy . when ( labware_view . get ( labware_id = "below-id" )). then_return (
1132
+ LoadedLabware (
1133
+ id = "below-id" ,
1134
+ loadName = "below-name " ,
1135
+ definitionUri = "1234 " ,
1136
+ location = DeckSlotLocation ( slotName = DeckSlotName . SLOT_4 ) ,
1137
+ )
1145
1138
)
1146
- )
1147
1139
1148
1140
decoy .when (labware_view .get_dimensions ("below-id" )).then_return (
1149
1141
Dimensions (x = 1000 , y = 1001 , z = 11 )
@@ -1163,7 +1155,7 @@ def test_get_labware_grip_point_on_labware(
1163
1155
labware_id = "labware-id" , location = OnLabwareLocation (labwareId = "below-id" )
1164
1156
)
1165
1157
1166
- assert grip_point == Point ( 5 , 10 , 115.0 )
1158
+ assert grip_point == expected_center_point
1167
1159
1168
1160
1169
1161
@pytest .mark .parametrize (
0 commit comments