-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_mapping.py
309 lines (302 loc) · 19.3 KB
/
test_mapping.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
import pytest as pytest
from dualsense_controller.core.enum import ConnectionType
from dualsense_controller.api.DualSenseController import Mapping
from dualsense_controller.core.state.typedef import Number
from tests.common import ControllerInstanceData, ControllerInstanceParams
# @pytest.mark.skip(reason="temp disabled")
@pytest.mark.parametrize(
'fixture_params_for_mocked_hidapi_device,fixture_params_for_controller_instance'
',left_stick_x_raw,left_stick_x_mapped'
',left_stick_y_raw,left_stick_y_mapped'
',right_stick_x_raw,right_stick_x_mapped'
',right_stick_y_raw,right_stick_y_mapped'
',left_trigger_raw,left_trigger_mapped'
',right_trigger_raw,right_trigger_mapped'
, [
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW),
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW),
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW),
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
127, 127, 127, 128, 127, 127, 127, 128, 127, 127, 127, 127],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
128, 128, 128, 127, 128, 128, 128, 127, 128, 128, 128, 128],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 255],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT),
0, -128, 0, 127, 0, -128, 0, 127, 0, 0, 0, 0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT),
127, -1, 127, 0, 127, -1, 127, 0, 127, 127, 127, 127],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT),
128, 0, 128, -1, 128, 0, 128, -1, 128, 128, 128, 128],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT),
255, 127, 255, -128, 255, 127, 255, -128, 255, 255, 255, 255],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
0, -128, 0, -128, 0, -128, 0, -128, 0, 0, 0, 0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
127, -1, 127, -1, 127, -1, 127, -1, 127, 127, 127, 127],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 128, 128, 128],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
255, 127, 255, 127, 255, 127, 255, 127, 255, 255, 255, 255],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED),
0, -1.0, 0, 1.0, 0, -1.0, 0, 1.0, 0, 0.0, 0, 0.0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED),
255, 1.0, 255, -1.0, 255, 1.0, 255, -1.0, 255, 1.0, 255, 1.0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
0, -1.0, 0, -1.0, 0, -1.0, 0, -1.0, 0, 0.0, 0, 0.0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
255, 1.00, 255, 1.00, 255, 1.00, 255, 1.00, 255, 1.0, 255, 1.0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.HUNDRED),
0, -100, 0, 100, 0, -100, 0, 100, 0, 0, 0, 0],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.HUNDRED),
127, 0, 127, 0, 127, 0, 127, 0, 127, 49, 127, 49],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.HUNDRED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 50, 128, 50],
[ConnectionType.USB_01, ControllerInstanceParams(Mapping.HUNDRED),
255, 100, 255, -100, 255, 100, 255, -100, 255, 100, 255, 100],
],
indirect=['fixture_params_for_mocked_hidapi_device', 'fixture_params_for_controller_instance']
)
def test_mapping_usb01(
fixture_params_for_mocked_hidapi_device: ConnectionType,
fixture_params_for_controller_instance: ControllerInstanceParams,
fixture_activated_instance: ControllerInstanceData,
left_stick_x_raw: int,
left_stick_x_mapped: Number,
left_stick_y_raw: int,
left_stick_y_mapped: Number,
right_stick_x_raw: int,
right_stick_x_mapped: Number,
right_stick_y_raw: int,
right_stick_y_mapped: Number,
left_trigger_raw: int,
left_trigger_mapped: Number,
right_trigger_raw: int,
right_trigger_mapped: Number,
) -> None:
fixture_activated_instance.mocked_hidapi_device.set_left_stick_x_raw(left_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_stick_y_raw(left_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_x_raw(right_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_y_raw(right_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_trigger_raw(left_trigger_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_trigger_raw(right_trigger_raw)
fixture_activated_instance.controller.wait_until_updated()
assert left_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_x.value, rel=1e-4)
assert left_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_y.value, rel=1e-4)
assert right_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_x.value, rel=1e-4)
assert right_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_y.value, rel=1e-4)
assert left_trigger_mapped == pytest.approx(fixture_activated_instance.controller.left_trigger.value, rel=1e-4)
assert right_trigger_mapped == pytest.approx(fixture_activated_instance.controller.right_trigger.value, rel=1e-4)
# @pytest.mark.skip(reason="temp disabled")
@pytest.mark.parametrize(
'fixture_params_for_mocked_hidapi_device,fixture_params_for_controller_instance'
',left_stick_x_raw,left_stick_x_mapped'
',left_stick_y_raw,left_stick_y_mapped'
',right_stick_x_raw,right_stick_x_mapped'
',right_stick_y_raw,right_stick_y_mapped'
',left_trigger_raw,left_trigger_mapped'
',right_trigger_raw,right_trigger_mapped'
, [
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW),
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW),
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW),
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW_INVERTED),
0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW_INVERTED),
127, 127, 127, 128, 127, 127, 127, 128, 127, 127, 127, 127],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW_INVERTED),
128, 128, 128, 127, 128, 128, 128, 127, 128, 128, 128, 128],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.RAW_INVERTED),
255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 255],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT),
0, -128, 0, 127, 0, -128, 0, 127, 0, 0, 0, 0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT),
127, -1, 127, 0, 127, -1, 127, 0, 127, 127, 127, 127],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT),
128, 0, 128, -1, 128, 0, 128, -1, 128, 128, 128, 128],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT),
255, 127, 255, -128, 255, 127, 255, -128, 255, 255, 255, 255],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
0, -128, 0, -128, 0, -128, 0, -128, 0, 0, 0, 0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
127, -1, 127, -1, 127, -1, 127, -1, 127, 127, 127, 127],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 128, 128, 128],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
255, 127, 255, 127, 255, 127, 255, 127, 255, 255, 255, 255],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED),
0, -1.0, 0, 1.0, 0, -1.0, 0, 1.0, 0, 0.0, 0, 0.0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED),
255, 1.0, 255, -1.0, 255, 1.0, 255, -1.0, 255, 1.0, 255, 1.0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
0, -1.0, 0, -1.0, 0, -1.0, 0, -1.0, 0, 0.0, 0, 0.0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
255, 1.00, 255, 1.00, 255, 1.00, 255, 1.00, 255, 1.0, 255, 1.0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.HUNDRED),
0, -100, 0, 100, 0, -100, 0, 100, 0, 0, 0, 0],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.HUNDRED),
127, 0, 127, 0, 127, 0, 127, 0, 127, 49, 127, 49],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.HUNDRED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 50, 128, 50],
[ConnectionType.BT_31, ControllerInstanceParams(Mapping.HUNDRED),
255, 100, 255, -100, 255, 100, 255, -100, 255, 100, 255, 100],
],
indirect=['fixture_params_for_mocked_hidapi_device', 'fixture_params_for_controller_instance']
)
def test_mapping_bt31(
fixture_params_for_mocked_hidapi_device: ConnectionType,
fixture_params_for_controller_instance: ControllerInstanceParams,
fixture_activated_instance: ControllerInstanceData,
left_stick_x_raw: int,
left_stick_x_mapped: Number,
left_stick_y_raw: int,
left_stick_y_mapped: Number,
right_stick_x_raw: int,
right_stick_x_mapped: Number,
right_stick_y_raw: int,
right_stick_y_mapped: Number,
left_trigger_raw: int,
left_trigger_mapped: Number,
right_trigger_raw: int,
right_trigger_mapped: Number,
) -> None:
fixture_activated_instance.mocked_hidapi_device.set_left_stick_x_raw(left_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_stick_y_raw(left_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_x_raw(right_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_y_raw(right_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_trigger_raw(left_trigger_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_trigger_raw(right_trigger_raw)
fixture_activated_instance.controller.wait_until_updated()
assert left_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_x.value, rel=1e-4)
assert left_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_y.value, rel=1e-4)
assert right_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_x.value, rel=1e-4)
assert right_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_y.value, rel=1e-4)
assert left_trigger_mapped == pytest.approx(fixture_activated_instance.controller.left_trigger.value, rel=1e-4)
assert right_trigger_mapped == pytest.approx(fixture_activated_instance.controller.right_trigger.value, rel=1e-4)
# @pytest.mark.skip(reason="temp disabled")
@pytest.mark.parametrize(
'fixture_params_for_mocked_hidapi_device,fixture_params_for_controller_instance'
',left_stick_x_raw,left_stick_x_mapped'
',left_stick_y_raw,left_stick_y_mapped'
',right_stick_x_raw,right_stick_x_mapped'
',right_stick_y_raw,right_stick_y_mapped'
',left_trigger_raw,left_trigger_mapped'
',right_trigger_raw,right_trigger_mapped'
, [
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW),
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW),
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW),
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
127, 127, 127, 128, 127, 127, 127, 128, 127, 127, 127, 127],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
128, 128, 128, 127, 128, 128, 128, 127, 128, 128, 128, 128],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.RAW_INVERTED),
255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 255],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT),
0, -128, 0, 127, 0, -128, 0, 127, 0, 0, 0, 0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT),
127, -1, 127, 0, 127, -1, 127, 0, 127, 127, 127, 127],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT),
128, 0, 128, -1, 128, 0, 128, -1, 128, 128, 128, 128],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT),
255, 127, 255, -128, 255, 127, 255, -128, 255, 255, 255, 255],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
0, -128, 0, -128, 0, -128, 0, -128, 0, 0, 0, 0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
127, -1, 127, -1, 127, -1, 127, -1, 127, 127, 127, 127],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 128, 128, 128],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.DEFAULT_INVERTED),
255, 127, 255, 127, 255, 127, 255, 127, 255, 255, 255, 255],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED),
0, -1.0, 0, 1.0, 0, -1.0, 0, 1.0, 0, 0.0, 0, 0.0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED),
255, 1.0, 255, -1.0, 255, 1.0, 255, -1.0, 255, 1.0, 255, 1.0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
0, -1.0, 0, -1.0, 0, -1.0, 0, -1.0, 0, 0.0, 0, 0.0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
127, 0.0, 127, 0.0, 127, 0.0, 127, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
128, 0.0, 128, 0.0, 128, 0.0, 128, 0.0, 127, 0.5, 127, 0.5],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.NORMALIZED_INVERTED),
255, 1.00, 255, 1.00, 255, 1.00, 255, 1.00, 255, 1.0, 255, 1.0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.HUNDRED),
0, -100, 0, 100, 0, -100, 0, 100, 0, 0, 0, 0],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.HUNDRED),
127, 0, 127, 0, 127, 0, 127, 0, 127, 49, 127, 49],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.HUNDRED),
128, 0, 128, 0, 128, 0, 128, 0, 128, 50, 128, 50],
[ConnectionType.BT_01, ControllerInstanceParams(Mapping.HUNDRED),
255, 100, 255, -100, 255, 100, 255, -100, 255, 100, 255, 100],
],
indirect=['fixture_params_for_mocked_hidapi_device', 'fixture_params_for_controller_instance']
)
def test_mapping_bt01(
fixture_params_for_mocked_hidapi_device: ConnectionType,
fixture_params_for_controller_instance: ControllerInstanceParams,
fixture_activated_instance: ControllerInstanceData,
left_stick_x_raw: int,
left_stick_x_mapped: Number,
left_stick_y_raw: int,
left_stick_y_mapped: Number,
right_stick_x_raw: int,
right_stick_x_mapped: Number,
right_stick_y_raw: int,
right_stick_y_mapped: Number,
left_trigger_raw: int,
left_trigger_mapped: Number,
right_trigger_raw: int,
right_trigger_mapped: Number,
) -> None:
fixture_activated_instance.mocked_hidapi_device.set_left_stick_x_raw(left_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_stick_y_raw(left_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_x_raw(right_stick_x_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_stick_y_raw(right_stick_y_raw)
fixture_activated_instance.mocked_hidapi_device.set_left_trigger_raw(left_trigger_raw)
fixture_activated_instance.mocked_hidapi_device.set_right_trigger_raw(right_trigger_raw)
fixture_activated_instance.controller.wait_until_updated()
assert left_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_x.value, rel=1e-4)
assert left_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.left_stick_y.value, rel=1e-4)
assert right_stick_x_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_x.value, rel=1e-4)
assert right_stick_y_mapped == pytest.approx(fixture_activated_instance.controller.right_stick_y.value, rel=1e-4)
assert left_trigger_mapped == pytest.approx(fixture_activated_instance.controller.left_trigger.value, rel=1e-4)
assert right_trigger_mapped == pytest.approx(fixture_activated_instance.controller.right_trigger.value, rel=1e-4)