def test_fillunfill(self): S = 4 buf = RingBuffer(S) for i in range(12): for j in range(S): buf.push(100 * i + j) for j in range(S): self.assertEqual(buf.pop(), 100 * i + j) # Moves ahead one space buf.push('NaN') buf.pop()
def test_pushpop(self): buf = RingBuffer(4) for i in range(12): buf.push(i) self.assertEqual(buf.pop(), i)