16
16
17
17
def test_build_aspirate_settings () -> None :
18
18
"""It should convert the shared data aspirate settings to the PAPI type."""
19
- fixture_data = load_shared_data ("liquid-class/fixtures/fixture_glycerol50.json" )
19
+ fixture_data = load_shared_data ("liquid-class/fixtures/1/ fixture_glycerol50.json" )
20
20
liquid_class_model = LiquidClassSchemaV1 .parse_raw (fixture_data )
21
21
aspirate_data = liquid_class_model .byPipette [0 ].byTipType [0 ].aspirate
22
22
@@ -32,7 +32,6 @@ def test_build_aspirate_settings() -> None:
32
32
assert aspirate_properties .retract .offset == Coordinate (x = 0 , y = 0 , z = 5 )
33
33
assert aspirate_properties .retract .speed == 100
34
34
assert aspirate_properties .retract .air_gap_by_volume .as_dict () == {
35
- "default" : 2.0 ,
36
35
5.0 : 3.0 ,
37
36
10.0 : 4.0 ,
38
37
}
@@ -45,7 +44,7 @@ def test_build_aspirate_settings() -> None:
45
44
46
45
assert aspirate_properties .position_reference .value == "well-bottom"
47
46
assert aspirate_properties .offset == Coordinate (x = 0 , y = 0 , z = - 5 )
48
- assert aspirate_properties .flow_rate_by_volume .as_dict () == {"default" : 50.0 }
47
+ assert aspirate_properties .flow_rate_by_volume .as_dict () == {10 : 50.0 }
49
48
assert aspirate_properties .pre_wet is True
50
49
assert aspirate_properties .mix .enabled is True
51
50
assert aspirate_properties .mix .repetitions == 3
@@ -56,7 +55,7 @@ def test_build_aspirate_settings() -> None:
56
55
57
56
def test_build_single_dispense_settings () -> None :
58
57
"""It should convert the shared data single dispense settings to the PAPI type."""
59
- fixture_data = load_shared_data ("liquid-class/fixtures/fixture_glycerol50.json" )
58
+ fixture_data = load_shared_data ("liquid-class/fixtures/1/ fixture_glycerol50.json" )
60
59
liquid_class_model = LiquidClassSchemaV1 .parse_raw (fixture_data )
61
60
single_dispense_data = liquid_class_model .byPipette [0 ].byTipType [0 ].singleDispense
62
61
@@ -75,7 +74,6 @@ def test_build_single_dispense_settings() -> None:
75
74
assert single_dispense_properties .retract .offset == Coordinate (x = 0 , y = 0 , z = 5 )
76
75
assert single_dispense_properties .retract .speed == 100
77
76
assert single_dispense_properties .retract .air_gap_by_volume .as_dict () == {
78
- "default" : 2.0 ,
79
77
5.0 : 3.0 ,
80
78
10.0 : 4.0 ,
81
79
}
@@ -93,15 +91,13 @@ def test_build_single_dispense_settings() -> None:
93
91
assert single_dispense_properties .position_reference .value == "well-bottom"
94
92
assert single_dispense_properties .offset == Coordinate (x = 0 , y = 0 , z = - 5 )
95
93
assert single_dispense_properties .flow_rate_by_volume .as_dict () == {
96
- "default" : 50.0 ,
97
94
10.0 : 40.0 ,
98
95
20.0 : 30.0 ,
99
96
}
100
97
assert single_dispense_properties .mix .enabled is True
101
98
assert single_dispense_properties .mix .repetitions == 3
102
99
assert single_dispense_properties .mix .volume == 15
103
100
assert single_dispense_properties .push_out_by_volume .as_dict () == {
104
- "default" : 5.0 ,
105
101
10.0 : 7.0 ,
106
102
20.0 : 10.0 ,
107
103
}
@@ -111,7 +107,7 @@ def test_build_single_dispense_settings() -> None:
111
107
112
108
def test_build_multi_dispense_settings () -> None :
113
109
"""It should convert the shared data multi dispense settings to the PAPI type."""
114
- fixture_data = load_shared_data ("liquid-class/fixtures/fixture_glycerol50.json" )
110
+ fixture_data = load_shared_data ("liquid-class/fixtures/1/ fixture_glycerol50.json" )
115
111
liquid_class_model = LiquidClassSchemaV1 .parse_raw (fixture_data )
116
112
multi_dispense_data = liquid_class_model .byPipette [0 ].byTipType [0 ].multiDispense
117
113
@@ -131,7 +127,6 @@ def test_build_multi_dispense_settings() -> None:
131
127
assert multi_dispense_properties .retract .offset == Coordinate (x = 0 , y = 0 , z = 5 )
132
128
assert multi_dispense_properties .retract .speed == 100
133
129
assert multi_dispense_properties .retract .air_gap_by_volume .as_dict () == {
134
- "default" : 2.0 ,
135
130
5.0 : 3.0 ,
136
131
10.0 : 4.0 ,
137
132
}
@@ -148,16 +143,13 @@ def test_build_multi_dispense_settings() -> None:
148
143
assert multi_dispense_properties .position_reference .value == "well-bottom"
149
144
assert multi_dispense_properties .offset == Coordinate (x = 0 , y = 0 , z = - 5 )
150
145
assert multi_dispense_properties .flow_rate_by_volume .as_dict () == {
151
- "default" : 50.0 ,
152
146
10.0 : 40.0 ,
153
147
20.0 : 30.0 ,
154
148
}
155
149
assert multi_dispense_properties .conditioning_by_volume .as_dict () == {
156
- "default" : 10.0 ,
157
150
5.0 : 5.0 ,
158
151
}
159
152
assert multi_dispense_properties .disposal_by_volume .as_dict () == {
160
- "default" : 2.0 ,
161
153
5.0 : 3.0 ,
162
154
}
163
155
assert multi_dispense_properties .delay .enabled is True
@@ -174,22 +166,20 @@ def test_build_multi_dispense_settings_none(
174
166
175
167
def test_liquid_handling_property_by_volume () -> None :
176
168
"""It should create a class that can interpolate values and add and delete new points."""
177
- subject = LiquidHandlingPropertyByVolume ({"default" : 42 , "5" : 50 , "10.0" : 250 })
178
- assert subject .as_dict () == {"default" : 42 , 5.0 : 50 , 10.0 : 250 }
179
- assert subject .default == 42.0
169
+ subject = LiquidHandlingPropertyByVolume ([(5.0 , 50.0 ), (10.0 , 250.0 )])
170
+ assert subject .as_dict () == {5.0 : 50 , 10.0 : 250 }
180
171
assert subject .get_for_volume (7 ) == 130.0
181
172
182
173
subject .set_for_volume (volume = 7 , value = 175.5 )
183
174
assert subject .as_dict () == {
184
- "default" : 42 ,
185
175
5.0 : 50 ,
186
176
10.0 : 250 ,
187
177
7.0 : 175.5 ,
188
178
}
189
179
assert subject .get_for_volume (7 ) == 175.5
190
180
191
181
subject .delete_for_volume (7 )
192
- assert subject .as_dict () == {"default" : 42 , 5.0 : 50 , 10.0 : 250 }
182
+ assert subject .as_dict () == {5.0 : 50 , 10.0 : 250 }
193
183
assert subject .get_for_volume (7 ) == 130.0
194
184
195
185
with pytest .raises (KeyError , match = "No value set for volume" ):
0 commit comments