def testGetTrailing(self): s = astar.Sequence(tail=0) assert [0] == s.GetTrailing(2) s = astar.Sequence(head=s, tail=1) s = astar.Sequence(head=s, tail=2) s = astar.Sequence(head=s, tail=3) s = astar.Sequence(head=s, tail=4) s = astar.Sequence(head=s, tail=5) s = astar.Sequence(head=s, tail=6) s = astar.Sequence(head=s, tail=7) assert [6, 7] == s.GetTrailing(2) assert [6, 7] == s.GetTrailing(2)
def testStr(self): s = astar.Sequence(tail=1) s = astar.Sequence(head=s, tail=2) assert isinstance(str(s), str)
def testConstructionAndIteration(self): s1 = astar.Sequence(tail=1) s2 = astar.Sequence(head=s1, tail=2) s3 = astar.Sequence(head=s2, tail=3) assert [1, 2, 3] == list(s3)
def testLen(self): s = astar.Sequence(tail=1) s = astar.Sequence(head=s, tail=2) assert 2 == len(s)