#NEWLINE# def runTest( self ) : #NEWLINE# #INDENT# shape = transitfeed . Shape ( 'TEST' ) #NEWLINE# repr ( shape ) #NEWLINE# self . ValidateAndExpectOtherProblem ( shape ) #NEWLINE# self . ExpectFailedAdd ( shape , 36.905019 , ( - 116.763207 ) , ( - 1 ) , 'shape_dist_traveled' , ( - 1 ) ) #NEWLINE# shape . AddPoint ( 36.91576 , ( - 116.751709 ) , 0 , self . problems ) #NEWLINE# shape . AddPoint ( 36.905018 , ( - 116.763206 ) , 5 , self . problems ) #NEWLINE# shape . Validate ( self . problems ) #NEWLINE# shape . shape_id = None #NEWLINE# self . ValidateAndExpectMissingValue ( shape , 'shape_id' ) #NEWLINE# shape . shape_id = 'TEST' #NEWLINE# self . ExpectFailedAdd ( shape , 91 , ( - 116.751709 ) , 6 , 'shape_pt_lat' , 91 ) #NEWLINE# self . ExpectFailedAdd ( shape , ( - 91 ) , ( - 116.751709 ) , 6 , 'shape_pt_lat' , ( - 91 ) ) #NEWLINE# self . ExpectFailedAdd ( shape , 36.91576 , ( - 181 ) , 6 , 'shape_pt_lon' , ( - 181 ) ) #NEWLINE# self . ExpectFailedAdd ( shape , 36.91576 , 181 , 6 , 'shape_pt_lon' , 181 ) #NEWLINE# self . ExpectFailedAdd ( shape , 0.5 , ( - 0.5 ) , 6 , 'shape_pt_lat' , 0.5 ) #NEWLINE# self . ExpectFailedAdd ( shape , 0 , 0 , 6 , 'shape_pt_lat' , 0 ) #NEWLINE# shape . AddPoint ( 36.905019 , ( - 116.763206 ) , 4 , self . problems ) #NEWLINE# e = self . accumulator . PopException ( 'InvalidValue' ) #NEWLINE# self . assertMatchesRegex ( 'Each subsequent point' , e . FormatProblem ( ) ) #NEWLINE# self . assertMatchesRegex ( 'distance was 5.000000.' , e . FormatProblem ( ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# shape . AddPoint ( 36.925019 , ( - 116.764206 ) , 6 , self . problems ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# shapepoint = transitfeed . ShapePoint ( 'TEST' , 36.91576 , ( - 116.7156 ) , 6 , 8 ) #NEWLINE# shape . AddShapePointObjectUnsorted ( shapepoint , self . problems ) #NEWLINE# shapepoint = transitfeed . ShapePoint ( 'TEST' , 36.91576 , ( - 116.7156 ) , 5 , 10 ) #NEWLINE# shape . AddShapePointObjectUnsorted ( shapepoint , self . problems ) #NEWLINE# e = self . accumulator . PopException ( 'InvalidValue' ) #NEWLINE# self . assertMatchesRegex ( 'Each subsequent point' , e . FormatProblem ( ) ) #NEWLINE# self . assertMatchesRegex ( 'distance was 8.000000.' , e . FormatProblem ( ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# shapepoint = transitfeed . ShapePoint ( 'TEST' , 36.91576 , ( - 116.7156 ) , 6 , 11 ) #NEWLINE# shape . AddShapePointObjectUnsorted ( shapepoint , self . problems ) #NEWLINE# e = self . accumulator . PopException ( 'InvalidValue' ) #NEWLINE# self . assertMatchesRegex ( 'The sequence number 6 occurs ' , e . FormatProblem ( ) ) #NEWLINE# self . assertMatchesRegex ( 'once in shape TEST.' , e . FormatProblem ( ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( )