@@ -150,14 +150,14 @@ def test_create_actor(self):
150
150
151
151
async def test_inistate (self ):
152
152
mockactor = create_mock_actor (MockTestActor , '1' , initstate = {'state' : 5 })
153
- self .assertTrue ('state' in mockactor ._state_manager ._mock_state )
154
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], 5 )
153
+ self .assertTrue ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
154
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], 5 ) # type: ignore
155
155
156
156
async def test_on_activate (self ):
157
157
mockactor = create_mock_actor (MockTestActor , '1' )
158
158
await mockactor ._on_activate ()
159
- self .assertTrue ('state' in mockactor ._state_manager ._mock_state )
160
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 })
159
+ self .assertTrue ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
160
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 }) # type: ignore
161
161
162
162
async def test_get_data (self ):
163
163
mockactor = create_mock_actor (MockTestActor , '1' )
@@ -173,48 +173,48 @@ async def test_get_data_initstate(self):
173
173
async def test_set_data (self ):
174
174
mockactor = create_mock_actor (MockTestActor , '1' )
175
175
await mockactor ._on_activate ()
176
- self .assertTrue ('state' in mockactor ._state_manager ._mock_state )
177
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 })
176
+ self .assertTrue ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
177
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 }) # type: ignore
178
178
await mockactor .set_data ({'test' : 10 })
179
- self .assertTrue ('state' in mockactor ._state_manager ._mock_state )
180
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 10 })
179
+ self .assertTrue ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
180
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 10 }) # type: ignore
181
181
out1 = await mockactor .get_data ()
182
182
self .assertEqual (out1 , {'test' : 10 })
183
183
184
184
async def test_clear_data (self ):
185
185
mockactor = create_mock_actor (MockTestActor , '1' )
186
186
await mockactor ._on_activate ()
187
- self .assertTrue ('state' in mockactor ._state_manager ._mock_state )
188
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 })
187
+ self .assertTrue ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
188
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 }) # type: ignore
189
189
await mockactor .clear_data ()
190
- self .assertFalse ('state' in mockactor ._state_manager ._mock_state )
191
- self .assertIsNone (mockactor ._state_manager ._mock_state .get ('state' ))
190
+ self .assertFalse ('state' in mockactor ._state_manager ._mock_state ) # type: ignore
191
+ self .assertIsNone (mockactor ._state_manager ._mock_state .get ('state' )) # type: ignore
192
192
out1 = await mockactor .get_data ()
193
193
self .assertIsNone (out1 )
194
194
195
195
async def test_toggle_reminder (self ):
196
196
mockactor = create_mock_actor (MockTestActor , '1' )
197
197
await mockactor ._on_activate ()
198
- self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 0 )
198
+ self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 0 ) # type: ignore
199
199
await mockactor .toggle_reminder ('test' , True )
200
- self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 1 )
201
- self .assertTrue ('test' in mockactor ._state_manager ._mock_reminders )
202
- reminderstate = mockactor ._state_manager ._mock_reminders ['test' ]
200
+ self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 1 ) # type: ignore
201
+ self .assertTrue ('test' in mockactor ._state_manager ._mock_reminders ) # type: ignore
202
+ reminderstate = mockactor ._state_manager ._mock_reminders ['test' ] # type: ignore
203
203
self .assertTrue (reminderstate .reminder_name , 'test' )
204
204
await mockactor .toggle_reminder ('test' , False )
205
- self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 0 )
205
+ self .assertEqual (len (mockactor ._state_manager ._mock_reminders ), 0 ) # type: ignore
206
206
207
207
async def test_toggle_timer (self ):
208
208
mockactor = create_mock_actor (MockTestActor , '1' )
209
209
await mockactor ._on_activate ()
210
- self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 0 )
210
+ self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 0 ) # type: ignore
211
211
await mockactor .toggle_timer ('test' , True )
212
- self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 1 )
213
- self .assertTrue ('test' in mockactor ._state_manager ._mock_timers )
214
- timerstate = mockactor ._state_manager ._mock_timers ['test' ]
212
+ self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 1 ) # type: ignore
213
+ self .assertTrue ('test' in mockactor ._state_manager ._mock_timers ) # type: ignore
214
+ timerstate = mockactor ._state_manager ._mock_timers ['test' ] # type: ignore
215
215
self .assertTrue (timerstate .timer_name , 'test' )
216
216
await mockactor .toggle_timer ('test' , False )
217
- self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 0 )
217
+ self .assertEqual (len (mockactor ._state_manager ._mock_timers ), 0 ) # type: ignore
218
218
219
219
async def test_activate_reminder (self ):
220
220
mockactor = create_mock_actor (MockTestActor , '1' )
@@ -225,7 +225,7 @@ async def test_activate_reminder(self):
225
225
datetime .timedelta (days = 1 ),
226
226
datetime .timedelta (days = 1 ),
227
227
)
228
- self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], True )
228
+ self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], True ) # type: ignore
229
229
230
230
async def test_test_data (self ):
231
231
mockactor = create_mock_actor (MockTestActor , '1' )
@@ -246,27 +246,27 @@ async def test_test_data(self):
246
246
247
247
async def test_add_state (self ):
248
248
mockactor = create_mock_actor (MockTestActor , '1' )
249
- self .assertFalse (mockactor ._state_manager ._mock_state )
249
+ self .assertFalse (mockactor ._state_manager ._mock_state ) # type: ignore
250
250
await mockactor .add_state ('test' , 5 )
251
- self .assertTrue ('test' in mockactor ._state_manager ._mock_state )
252
- self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 5 )
251
+ self .assertTrue ('test' in mockactor ._state_manager ._mock_state ) # type: ignore
252
+ self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 5 ) # type: ignore
253
253
await mockactor .add_state ('test2' , 10 )
254
- self .assertTrue ('test2' in mockactor ._state_manager ._mock_state )
255
- self .assertEqual (mockactor ._state_manager ._mock_state ['test2' ], 10 )
256
- self .assertEqual (len (mockactor ._state_manager ._mock_state ), 2 )
254
+ self .assertTrue ('test2' in mockactor ._state_manager ._mock_state ) # type: ignore
255
+ self .assertEqual (mockactor ._state_manager ._mock_state ['test2' ], 10 ) # type: ignore
256
+ self .assertEqual (len (mockactor ._state_manager ._mock_state ), 2 ) # type: ignore
257
257
with self .assertRaises (ValueError ):
258
258
await mockactor .add_state ('test' , 10 )
259
259
260
260
async def test_update_state (self ):
261
261
mockactor = create_mock_actor (MockTestActor , '1' )
262
- self .assertFalse (mockactor ._state_manager ._mock_state )
262
+ self .assertFalse (mockactor ._state_manager ._mock_state ) # type: ignore
263
263
await mockactor .update_state ('test' , 10 )
264
- self .assertTrue ('test' in mockactor ._state_manager ._mock_state )
265
- self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 10 )
264
+ self .assertTrue ('test' in mockactor ._state_manager ._mock_state ) # type: ignore
265
+ self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 10 ) # type: ignore
266
266
await mockactor .update_state ('test' , 10 )
267
- self .assertTrue ('test' in mockactor ._state_manager ._mock_state )
268
- self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 20 )
269
- self .assertEqual (len (mockactor ._state_manager ._mock_state ), 1 )
267
+ self .assertTrue ('test' in mockactor ._state_manager ._mock_state ) # type: ignore
268
+ self .assertEqual (mockactor ._state_manager ._mock_state ['test' ], 20 ) # type: ignore
269
+ self .assertEqual (len (mockactor ._state_manager ._mock_state ), 1 ) # type: ignore
270
270
271
271
async def test_state_change_tracker (self ):
272
272
mockactor = create_mock_actor (MockTestActor , '1' )
@@ -281,7 +281,7 @@ async def test_state_change_tracker(self):
281
281
self .assertEqual (
282
282
mockactor ._state_manager ._default_state_change_tracker ['state' ].value , {'test' : 5 }
283
283
)
284
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 })
284
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 5 }) # type: ignore
285
285
await mockactor .remove_data_no_save ()
286
286
self .assertEqual (
287
287
mockactor ._state_manager ._default_state_change_tracker ['state' ].change_kind ,
@@ -290,10 +290,10 @@ async def test_state_change_tracker(self):
290
290
self .assertEqual (
291
291
mockactor ._state_manager ._default_state_change_tracker ['state' ].value , {'test' : 5 }
292
292
)
293
- self .assertTrue ('state' not in mockactor ._state_manager ._mock_state )
293
+ self .assertTrue ('state' not in mockactor ._state_manager ._mock_state ) # type: ignore
294
294
await mockactor .save_state ()
295
295
self .assertEqual (len (mockactor ._state_manager ._default_state_change_tracker ), 0 )
296
- self .assertTrue ('state' not in mockactor ._state_manager ._mock_state )
296
+ self .assertTrue ('state' not in mockactor ._state_manager ._mock_state ) # type: ignore
297
297
await mockactor .add_data_no_save ({'test' : 6 })
298
298
self .assertEqual (
299
299
mockactor ._state_manager ._default_state_change_tracker ['state' ].change_kind ,
@@ -302,7 +302,7 @@ async def test_state_change_tracker(self):
302
302
self .assertEqual (
303
303
mockactor ._state_manager ._default_state_change_tracker ['state' ].value , {'test' : 6 }
304
304
)
305
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 6 })
305
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 6 }) # type: ignore
306
306
await mockactor .save_state ()
307
307
self .assertEqual (
308
308
mockactor ._state_manager ._default_state_change_tracker ['state' ].change_kind ,
@@ -311,4 +311,4 @@ async def test_state_change_tracker(self):
311
311
self .assertEqual (
312
312
mockactor ._state_manager ._default_state_change_tracker ['state' ].value , {'test' : 6 }
313
313
)
314
- self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 6 })
314
+ self .assertEqual (mockactor ._state_manager ._mock_state ['state' ], {'test' : 6 }) # type: ignore
0 commit comments