#NEWLINE# def testDuplicateTransfer( self ) : #NEWLINE# #INDENT# self . AppendToArchiveContents ( 'stops.txt' , 'BEATTY_AIRPORT_HANGER,Airport Hanger,36.868178,-116.784915\nBEATTY_AIRPORT_34,Runway 34,36.85352,-116.786316\n' ) #NEWLINE# self . AppendToArchiveContents ( 'trips.txt' , 'AB,FULLW,AIR1\n' ) #NEWLINE# self . AppendToArchiveContents ( 'stop_times.txt' , 'AIR1,7:00:00,7:00:00,BEATTY_AIRPORT_HANGER,1\nAIR1,7:05:00,7:05:00,BEATTY_AIRPORT_34,2\nAIR1,7:10:00,7:10:00,BEATTY_AIRPORT_HANGER,3\n' ) #NEWLINE# self . SetArchiveContents ( 'transfers.txt' , 'from_stop_id,to_stop_id,transfer_type\nBEATTY_AIRPORT,BEATTY_AIRPORT_HANGER,0\nBEATTY_AIRPORT,BEATTY_AIRPORT_HANGER,3' ) #NEWLINE# schedule = self . MakeLoaderAndLoad ( ) #NEWLINE# e = self . accumulator . PopException ( 'DuplicateID' ) #NEWLINE# self . assertEquals ( '(from_stop_id, to_stop_id)' , e . column_name ) #NEWLINE# self . assertEquals ( '(BEATTY_AIRPORT, BEATTY_AIRPORT_HANGER)' , e . value ) #NEWLINE# self . assertTrue ( e . IsWarning ( ) ) #NEWLINE# self . assertEquals ( 'transfers.txt' , e . file_name ) #NEWLINE# self . assertEquals ( 3 , e . row_num ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# saved_schedule_file = StringIO ( ) #NEWLINE# schedule . WriteGoogleTransitFeed ( saved_schedule_file ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# load_problems = util . GetTestFailureProblemReporter ( self , ( 'ExpirationDate' , 'DuplicateID' ) ) #NEWLINE# loaded_schedule = transitfeed . Loader ( saved_schedule_file , problems = load_problems , extra_validation = True ) . Load ( ) #NEWLINE# self . assertEquals ( [ 0 , 3 ] , [ int ( t . transfer_type ) for t in loaded_schedule . GetTransferIter ( ) ] )