コード例 #1
0
def test_dequeue():
    q = MyQueue()
    q.enqueue(1)
    q.enqueue(2)
    assert 2 == q.size()
    assert 1 == q.dequeue()
    assert 1 == q.size()
    assert 2 == q.dequeue()
    assert 0 == q.size()
    assert 1 == q.isEmpty()
コード例 #2
0
def test_empty():
    q = MyQueue()
    assert 1 == q.isEmpty()
    q.enqueue(1)
    assert 0 == q.isEmpty()