@@ -77,11 +77,9 @@ def test_acceleration(self):
77
77
MOCK_MOTION_Z = 3
78
78
MOCK_MOTION_X_B = 4
79
79
80
- clue ._Clue__state ["acceleration" ] = {
81
- "x" : MOCK_MOTION_X_A ,
82
- "y" : MOCK_MOTION_Y ,
83
- "z" : MOCK_MOTION_Z ,
84
- }
80
+ clue ._Clue__state ["acceleration" ].update (
81
+ {"x" : MOCK_MOTION_X_A , "y" : MOCK_MOTION_Y , "z" : MOCK_MOTION_Z ,}
82
+ )
85
83
assert clue .acceleration == (MOCK_MOTION_X_A , MOCK_MOTION_Y , MOCK_MOTION_Z )
86
84
clue ._Clue__state ["acceleration" ]["x" ] = MOCK_MOTION_X_B
87
85
assert clue .acceleration == (MOCK_MOTION_X_B , MOCK_MOTION_Y , MOCK_MOTION_Z )
@@ -93,12 +91,14 @@ def test_color(self):
93
91
MOCK_COLOR_C = 4
94
92
MOCK_COLOR_R_B = 5
95
93
96
- clue ._Clue__state ["color" ] = {
97
- "r" : MOCK_COLOR_R_A ,
98
- "g" : MOCK_COLOR_G ,
99
- "b" : MOCK_COLOR_B ,
100
- "c" : MOCK_COLOR_C ,
101
- }
94
+ clue ._Clue__state ["color" ].update (
95
+ {
96
+ "r" : MOCK_COLOR_R_A ,
97
+ "g" : MOCK_COLOR_G ,
98
+ "b" : MOCK_COLOR_B ,
99
+ "c" : MOCK_COLOR_C ,
100
+ }
101
+ )
102
102
assert clue .color == (MOCK_COLOR_R_A , MOCK_COLOR_G , MOCK_COLOR_B , MOCK_COLOR_C )
103
103
assert clue ._Clue__state ["color" ]["r" ] == MOCK_COLOR_R_B
104
104
assert clue .color == (MOCK_COLOR_R_B , MOCK_COLOR_G , MOCK_COLOR_B , MOCK_COLOR_C )
@@ -117,11 +117,9 @@ def test_magnetic(self):
117
117
MOCK_MAGNETIC_Z = 3
118
118
MOCK_MAGNETIC_X_B = 4
119
119
120
- clue ._Clue__state ["magnetometer" ] = {
121
- "x" : MOCK_MAGNETIC_X_A ,
122
- "y" : MOCK_MAGNETIC_Y ,
123
- "z" : MOCK_MAGNETIC_Z ,
124
- }
120
+ clue ._Clue__state ["magnetometer" ].update (
121
+ {"x" : MOCK_MAGNETIC_X_A , "y" : MOCK_MAGNETIC_Y , "z" : MOCK_MAGNETIC_Z ,}
122
+ )
125
123
assert clue .acceleration == (
126
124
MOCK_MAGNETIC_X_A ,
127
125
MOCK_MAGNETIC_Y ,
@@ -148,11 +146,9 @@ def test_gyro(self):
148
146
MOCK_GYRO_Z = 3
149
147
MOCK_GYRO_X_B = 4
150
148
151
- clue ._Clue__state ["gyro" ] = {
152
- "x" : MOCK_GYRO_X_A ,
153
- "y" : MOCK_GYRO_Y ,
154
- "z" : MOCK_GYRO_Z ,
155
- }
149
+ clue ._Clue__state ["gyro" ].update (
150
+ {"x" : MOCK_GYRO_X_A , "y" : MOCK_GYRO_Y , "z" : MOCK_GYRO_Z ,}
151
+ )
156
152
assert clue .gyro == (MOCK_GYRO_X_A , MOCK_GYRO_Y , MOCK_GYRO_Z )
157
153
clue ._Clue__state ["gyro" ]["x" ] = MOCK_GYRO_X_B
158
154
assert clue .gyro == (MOCK_GYRO_X_B , MOCK_GYRO_Y , MOCK_GYRO_Z )
@@ -184,8 +180,8 @@ def test_pressure(self):
184
180
def test_altitude (self ):
185
181
MOCK_PRESSURE_A = 1000
186
182
MOCK_PRESSURE_B = 1030
187
- MOCK_ALTITUDE_A = 125.42
188
- MOCK_ALTITUDE_B = - 123.93
183
+ MOCK_ALTITUDE_A = 125.42255615546036
184
+ MOCK_ALTITUDE_B = - 123.93061640175468
189
185
SEA_LEVEL_PRESSURE = 1015
190
186
clue .sea_level_pressure = SEA_LEVEL_PRESSURE
191
187
clue ._Clue__state ["pressure" ] = MOCK_PRESSURE_A
@@ -202,6 +198,6 @@ def test_pixel(self):
202
198
MOCK_RED = (255 , 0 , 0 )
203
199
MOCK_WHITE = (255 , 255 , 255 )
204
200
clue .pixel .fill (MOCK_RED )
205
- assert MOCK_RED == clue .pixel
201
+ assert [ MOCK_RED ] == clue .pixel
206
202
clue .pixel .fill (MOCK_WHITE )
207
- assert MOCK_WHITE == clue .pixel
203
+ assert [ MOCK_WHITE ] == clue .pixel
0 commit comments