File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,9 @@ def run(self):
181
181
182
182
183
183
class _RPCExceptions (AutoDB ):
184
+ class DBKeys :
185
+ core = Device ()
186
+
184
187
def build (self ):
185
188
self .success = False
186
189
@@ -199,6 +202,17 @@ def catch(self):
199
202
self .success = True
200
203
201
204
205
+ class _Watchdog (AutoDB ):
206
+ class DBKeys :
207
+ core = Device ()
208
+
209
+ @kernel
210
+ def run (self ):
211
+ with watchdog (50 * ms ):
212
+ while True :
213
+ pass
214
+
215
+
202
216
@unittest .skipUnless (core_device , "no hardware" )
203
217
class ExecutionCase (unittest .TestCase ):
204
218
def test_primes (self ):
@@ -259,6 +273,10 @@ def test_rpc_exceptions(self):
259
273
finally :
260
274
comm .close ()
261
275
276
+ def test_watchdog (self ):
277
+ with self .assertRaises (IOError ):
278
+ _run_on_device (_Watchdog )
279
+
262
280
263
281
class _RTIOLoopback (AutoDB ):
264
282
class DBKeys :
You can’t perform that action at this time.
0 commit comments