def testpop_exception(self): r=DLList([1,2,'boy','cat',9]) try: a = r.pop(20) self.assertTrue(False,'No Exception or/ right type of exception raised') except IndexError: pass
def testpop_mid(self): r=DLList([1,2,'boy','cat',9]) a = r.pop(2) self.assertEqual(a,'boy') self.assertEqual(str(r),str([1,2,'cat',9]))
def testpop_start(self): r=DLList([1,2,'boy','cat',9]) a = r.pop(0) self.assertEqual(a,1) self.assertEqual(str(r),str([2,'boy','cat',9]))
def testpop_end(self): r=DLList([1,2,'boy','cat',9]) a = r.pop() self.assertEqual(a,9) self.assertEqual(str(r),str([1,2,'boy','cat']))