Simulator should occasionally throw errors
This lets me test LED blinking code. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
da3278d198
commit
c877f6db00
|
@ -13,10 +13,12 @@ class Request:
|
|||
pass
|
||||
|
||||
def read(self):
|
||||
if random.randint(0, 1) == 0:
|
||||
val = random.randint(0, 2)
|
||||
if val == 0:
|
||||
return "OK".encode()
|
||||
return "ERROR".encode()
|
||||
|
||||
elif val == 1:
|
||||
return "ERROR".encode()
|
||||
raise Exception('Test Exception')
|
||||
|
||||
|
||||
def urlopen(url):
|
||||
|
|
Loading…
Reference in New Issue