def test_expand(self):
        """vertices gettable after resizing"""
        
        # the path length right before a vector expansion
        pathlen = 50
        
        # make a bunch of fake segments
        segments = []
        for i in range(pathlen):
            vv = Vertex(str(i))
            ee = Edge( vv, vv, Link() )
            segments.append( (vv, ee) )
        
        # add those segments to the path
        for vv, ee in segments:
            self.path.addSegment( vv, ee ) 
            
        # check that they're alright
        # check the odd-duck vertex
        self.assertEqual( self.path.getVertex(0).label, "A" )
        
        # check the bunch of fake segments added
        for i in range(1, pathlen+1):
            self.assertEqual( 1-i, int(self.path.getVertex(i).label) )
            
        #
        # getting towards the real test - add a segment after the vectors have
        # been expanded
        #
        
        # add it
        vv = Vertex("B")
        ee = Edge(vv, vv, Link())
        self.path.addSegment( vv, ee )
        
        # get it
        self.assertEqual( self.path.getVertex( 51 ).label, "B" )
dataset/ETHPy150Open bmander/graphserver/pygs/test/unit_test/test_path.py/TestAddAndGetSegments.test_expand/swapped operands of `-`