def test_pop( self ): s = StringList( initial = initList ) s1 = s.pop() self.assertTrue( len(s) == 2 ) self.assertTrue( s1 == "S33") s1 = s.pop() self.assertTrue( len(s) == 1 ) self.assertTrue( s1 == "SABC") s1 = s.pop() self.assertTrue( len(s) == 0 ) self.assertTrue( s1 == "S1") self.assertRaises( IndexError , pop_empty )
def last_empty(): s = StringList( initial = initList ) s.pop() s.pop() s.pop() s.last
def pop_empty(): s = StringList( initial = initList ) s.pop() s.pop() s.pop() s.pop()