def baseRoad(request): _ = Road() print('\n') try: lengths = request.param except AttributeError: lengths = [] for length in lengths: _.addSegment(Segment(length)) print('adding segment with length {}'.format(length)) print('road created') return _
def basicRoad(): r = Road() r.addSegment(Segment(100, theGear=Gear.DIRECT)) r.addSegment(Segment(50, theGear=Gear.TURN)) r.addSegment(Segment(100, theGear=Gear.DIRECT)) r.addSegment(Segment(50, theGear=Gear.TURN)) return r