#NEWLINE# def testDuplicateId( self ) : #NEWLINE# #INDENT# schedule = self . SimpleSchedule ( ) #NEWLINE# transfer1 = transitfeed . Transfer ( from_stop_id = 'stop1' , to_stop_id = 'stop2' ) #NEWLINE# schedule . AddTransferObject ( transfer1 ) #NEWLINE# transfer2 = transitfeed . Transfer ( field_dict = transfer1 ) #NEWLINE# transfer2 . transfer_type = 3 #NEWLINE# schedule . AddTransferObject ( transfer2 ) #NEWLINE# transfer2 . Validate ( ) #NEWLINE# e = self . accumulator . PopException ( 'DuplicateID' ) #NEWLINE# self . assertEquals ( '(from_stop_id, to_stop_id)' , e . column_name ) #NEWLINE# self . assertEquals ( '(stop1, stop2)' , e . value ) #NEWLINE# self . assertTrue ( e . IsWarning ( ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# self . assertEquals ( transfer1 , schedule . GetTransferList ( ) [ 0 ] ) #NEWLINE# self . assertEquals ( transfer2 , schedule . GetTransferList ( ) [ 1 ] ) #NEWLINE# transfer3 = transitfeed . Transfer ( from_stop_id = 'stop1' , to_stop_id = 'stop3' ) #NEWLINE# schedule . AddTransferObject ( transfer3 ) #NEWLINE# self . assertEquals ( 3 , len ( schedule . GetTransferList ( ) ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( ) #NEWLINE# transfer4 = transitfeed . Transfer ( from_stop_id = 'stop1' ) #NEWLINE# schedule . AddTransferObject ( transfer4 ) #NEWLINE# self . assertEquals ( ',stop2,stop2,stop3' , ',' . join ( sorted ( ( t [ 'to_stop_id' ] for t in schedule . GetTransferIter ( ) ) ) ) ) #NEWLINE# self . accumulator . AssertNoMoreExceptions ( )