Exemplo n.º 1
0
 def setUp(self):
     self.timeline = Timeline()
     self.os1 = OperatingSystem("Unics", 1969)
     self.os2 = OperatingSystem("Windows 95", 1995)
     self.os3 = OperatingSystem("Mac OS X", 2000)
     self.timeline.head = self.os1
     self.timeline.head.next = self.os2
     self.os2.next = self.os3
Exemplo n.º 2
0
class TestA(unittest.TestCase):
    def setUp(self):
        self.timeline = Timeline()
        self.os1 = OperatingSystem("Unics", 1969)
        self.os2 = OperatingSystem("Windows 95", 1995)
        self.os3 = OperatingSystem("Mac OS X", 2000)
        self.timeline.head = self.os1
        self.timeline.head.next = self.os2
        self.os2.next = self.os3

    def runTest(self):
        self.timeline.insert("Linux 0.1", 1990)
        self.assertEqual(self.timeline.traverse(), [('Unics', 1969),
                                                    ('Linux 0.1', 1990),
                                                    ('Windows 95', 1995),
                                                    ('Mac OS X', 2000)])