Exemple #1
0
    def test_U(self):
        l = DLlist()
        l.push_front('A')
        l.push_front('B')
        l.push_front('C')
        l.push_front('D')

        self.assertTrue(len(l) == 4 and
                        l[-1] == 'A' and
                        l[-2] == 'B' and
                        l[-3] == 'C' and
                        l[-4] == 'D')
Exemple #2
0
    def test_T(self):
        l = DLlist()
        l.push_front('A')
        l.push_front('B')
        l.push_front('C')
        l.push_front('D')

        self.assertTrue(len(l) == 4 and
                        l[0] == 'D' and
                        l[1] == 'C' and
                        l[2] == 'B' and
                        l[3] == 'A')