Source

pyfiboheap / tests / test_order.py

Full commit
import fiboheaps
import unittest
import random

class TestOrder(unittest.TestCase):
    def setUp(self):
        self.heap = fiboheaps.FibonacciHeap()
        self.sequence = list(range(10))
        self.scrambled_sequence = list(self.sequence)
        random.shuffle(self.scrambled_sequence)
        for element in self.scrambled_sequence:
            self.heap.push(element)

    def testMinProperties(self):
        for el in self.sequence:
            self.assertEqual(el, self.heap.pop())
        self.assertEquals(0, len(self.heap))