Skip to content

Commit 967cad7

Browse files
committed
tests/extmod/utimeq1: Improve coverage of utimeq module.
1 parent c7e8c6f commit 967cad7

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

tests/extmod/utimeq1.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,41 @@ def dprint(*v):
3434
except IndexError:
3535
pass
3636

37+
# unsupported unary op
38+
try:
39+
~h
40+
assert False
41+
except TypeError:
42+
pass
43+
44+
# pushing on full queue
45+
h = utimeq(1)
46+
h.push(1, 0, 0)
47+
try:
48+
h.push(2, 0, 0)
49+
assert False
50+
except IndexError:
51+
pass
52+
53+
# popping into invalid type
54+
try:
55+
h.pop([])
56+
assert False
57+
except TypeError:
58+
pass
59+
60+
# length
61+
assert len(h) == 1
62+
63+
# peektime
64+
assert h.peektime() == 1
65+
66+
# peektime with empty queue
67+
try:
68+
utimeq(1).peektime()
69+
assert False
70+
except IndexError:
71+
pass
3772

3873
def pop_all(h):
3974
l = []

0 commit comments

Comments
 (0)