MCPcopy
hub / github.com/raiden-network/raiden / test_queue

Function test_queue

raiden/tests/unit/test_notifyingqueue.py:8–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def test_queue():
9 queue = NotifyingQueue()
10 assert queue.copy() == []
11
12 queue.put(1)
13 assert queue.copy() == [1]
14 assert queue.peek() == 1, "copy must preserve the queue"
15
16 queue.put(2)
17 assert queue.copy() == [1, 2], "copy must preserve the items order"
18 assert queue.peek() == 1, "copy must preserve the queue"
19
20 assert queue.get() == 1, "get should return first item"
21 assert queue.peek() == 2, "get must remove first item"
22
23
24def test_not_empty():

Callers

nothing calls this directly

Calls 5

copyMethod · 0.95
putMethod · 0.95
peekMethod · 0.95
getMethod · 0.95
NotifyingQueueClass · 0.90

Tested by

no test coverage detected