示例#1
0
    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 )
示例#2
0
def last_empty():
    s = StringList( initial = initList )
    s.pop()
    s.pop()
    s.pop()
    s.last
示例#3
0
def pop_empty():
    s = StringList( initial = initList )
    s.pop()
    s.pop()
    s.pop()
    s.pop()