summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-04-13 23:34:28 +1000
committerDamien George <damien.p.george@gmail.com>2017-04-13 23:34:28 +1000
commit967cad7434ee8e814c07ecccc6b642704dc46eaf (patch)
tree4a043baa1fbe621aaef4fc8f081ececbd5fa3fb5 /tests
parentc7e8c6f7dec539aae4ca6445541533bfbc1a1405 (diff)
downloadmicropython-967cad7434ee8e814c07ecccc6b642704dc46eaf.tar.gz
micropython-967cad7434ee8e814c07ecccc6b642704dc46eaf.zip
tests/extmod/utimeq1: Improve coverage of utimeq module.
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/utimeq1.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/extmod/utimeq1.py b/tests/extmod/utimeq1.py
index 9af7236744..68d69e25e6 100644
--- a/tests/extmod/utimeq1.py
+++ b/tests/extmod/utimeq1.py
@@ -34,6 +34,41 @@ try:
except IndexError:
pass
+# unsupported unary op
+try:
+ ~h
+ assert False
+except TypeError:
+ pass
+
+# pushing on full queue
+h = utimeq(1)
+h.push(1, 0, 0)
+try:
+ h.push(2, 0, 0)
+ assert False
+except IndexError:
+ pass
+
+# popping into invalid type
+try:
+ h.pop([])
+ assert False
+except TypeError:
+ pass
+
+# length
+assert len(h) == 1
+
+# peektime
+assert h.peektime() == 1
+
+# peektime with empty queue
+try:
+ utimeq(1).peektime()
+ assert False
+except IndexError:
+ pass
def pop_all(h):
l = []