Add and Remove operations for between stops
[bus.git] / origin-src / testtransitfeed.pyc
1
2 ^'Kc@s ddkZddklZddkZddkZddkZddkZddkZddkZddk Z ddk
3 Z
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 Use TestFailureProblemReporter in new code because it fails more cleanly, is
54 easier to extend and does more thorough checking.
55
56 expirationtcontext((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pytExpirationDate8sN(t__name__t
57
58
59 WdS(Ntproblemstextra_validation(R RtLoaderR
60 RRtLoadtValidate(Rtfeedtloadertschedule((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pytrunTesths
61
62
63
64 line2s
65
66
67 line2
68 line3
69 s
70
71
72
73
74
75
76 line2
77 line3
78 line4s
79 <StringIO>RPssFound 1 CR LF "\r\n" line end (line 2) and 2 LF "\n" line ends (lines 1, 3). A file must use a consistent line end.(
80
81 2
82 3
83 4
84 5
85 6
86 7
87 8
88 9
89 10
90 11
91 s
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106 RRR=(RR@((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBs
107
108
109 R
110 RR<RRR=R%t FeedNotFoundRJR^(RR^R@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBs   
111
112
113 R
114 RR<RRR=R%t UnknownFormatRJR^(RR^R@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRB,s   
115
116 agency.txtt agency_langes stops.txttstop_uris
117 routes.txttRoute_Text_Colors calendar.txttleap_dayscalendar_dates.txts trips.txtt sharpe_idsstop_times.txttshapedisttraveledt drop_off_timesfare_attributes.txtt transfer_timesfare_rules.txtt source_idsfrequencies.txtt superfluouss transfers.txttto_stopsunexpected errors: %ssexpected but not found: %s(s
118 agency.txtRs(s stops.txtRt(s
119 routes.txtRu(s calendar.txtRv(scalendar_dates.txtRv(s trips.txtRw(sstop_times.txtRx(sstop_times.txtRy(sfare_attributes.txtRz(sfare_rules.txtR{(sfrequencies.txtR|(s transfers.txtR}(
120 R+RR<R
121 R=RR,t
122 differencetfailIftstr(RR:R@t found_errorstexpected_errorst not_expectedt not_found((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRB9s,  
123
124 routes.txti(R=R:RIt assertEqualsR.RKRM(RR&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBVs
125
126
127
128
129 RR:RR<RR=RIRJR.RM(RR^R@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBis   
130
131 RRR=(RR@((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBvs
132
133 o2}|it i
134
135 RRR=R%t
136 FileFormatRQRZR[R"R#(RR@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBs   
137
138 o2}|it i
139
140
141
142
143
144
145
146
147
148
149
150
151
152 agency.txtt stop_names stops.txttroute_short_names
153
154
155
156
157 empty_fileR:R;sEmptyFile exception expecteds
158 agency.txt(
159 RR<R
160 RRR=R%t EmptyFileRJR.(RR@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBs   
161
162
163
164
165 RRR=R%t MissingColumnRJR.R/(RR@R&((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRBs   
166
167 onXdS(NRdtduplicate_stopR;sOtherProblem exception expected(RReRR=R
168
169 RRReR=R
170
171
172
173
174 onXdS(NRdtduplicate_schedule_idR;sDuplicateID exception expected(RReRR=R
175
176
177 
178 
179
180
181 
182
183 
184
185 
186
187
188
189
190
191
192 Nt
193
194
195
196
197
198
199
200
201
202
203 o }nXd|_ d|_ d|_ d |_d
204
205
206 isinstancet
207
208
209 d
210
211
212
213
214
215
216
217
218 short_namet54Ct long_names Polish Hillt
219
220 dist_deltat
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243 dS(NRRs
244 agency.txtsgagency_id,agency_name,agency_url,agency_timezone
245 DTA,Demo Agency,http://google.com,America/Los_Angeles
246
247 FULLW,1,1,1,1,1,1,1,20070101,20101231
248 WE,0,0,0,0,0,1,1,20070101,20101231
249 s
250 routes.txtsZroute_id,agency_id,route_short_name,route_long_name,route_type
251 AB,DTA,,Airport Bullfrog,3
252 s trips.txts)route_id,service_id,trip_id
253 AB,FULLW,AB1
254
255 BEATTY_AIRPORT,Airport,36.868446,-116.784582
256 BULLFROG,Bullfrog,36.88108,-116.81797
257 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677
258
259 AB1,10:00:00,10:00:00,BEATTY_AIRPORT,1
260 AB1,10:20:00,10:20:00,BULLFROG,2
261 AB1,10:25:00,10:25:00,STAGECOACH,3
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281 id1 , my name
282
283 id1,
284
285 Nstest.txts9test_id,"test_name",test_size
286 "id1" , "my name" , "234 "
287
288 Nstest.txts3id,name1,name2
289 "1", "brown, tom", "brown, ""tom"""
290
291
292 R`RaR0ttestname(
293
294
295
296 R`RoRaR0(
297
298
299 id1,my name
300
301
302
303 id1,my name,
304
305
306 Nstest.txtstest_id,test_name
307 id1 my name
308
309
310
311
312 BEATTY_AIRPORT,BEATTY_AIRPORT,BULLFROG,3,,2,,,,
313 BULLFROG,BULLFROG,BEATTY_AIRPORT,2,1200,1,,,,
314
315
316
317
318
319
320
321
322
323
324 FULLW,1,1,1,1,1,1,1,20070101,20101231,,,,,
325
326
327
328
329
330 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
331 STATION,Airport,36.868446,-116.784582,1,
332 BULLFROG,Bullfrog,36.88108,-116.81797,,
333 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
334
335
336 BEATTY_AIRPORT,Airport,36.868446,-116.784582,2
337 BULLFROG,Bullfrog,36.88108,-116.81797,notvalid
338 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,
339
340 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
341 STATION,Airport,36.868446,-116.784582,2,
342 BULLFROG,Bullfrog,36.88108,-116.81797,,
343 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
344
345
346 BEATTY_AIRPORT,Airport,36.868446,-116.784582,1
347 BULLFROG,Bullfrog,36.88108,-116.81797,
348 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,
349
350 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
351 BULLFROG,Bullfrog,36.88108,-116.81797,,
352 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
353
354 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,BULLFROG
355 BULLFROG,Bullfrog,36.88108,-116.81797,,
356 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
357
358
359 BEATTY_AIRPORT,Airport,36.868446,-116.784582,2,BULLFROG
360 BULLFROG,Bullfrog,36.88108,-116.81797,,
361 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
362
363 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
364 STATION,Airport,36.868446,-116.784582,1,STATION2
365 STATION2,Airport 2,36.868000,-116.784000,1,
366 BULLFROG,Bullfrog,36.868088,-116.784797,,STATION2
367 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
368
369
370 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
371 STATION,Airport,36.868446,-116.784582,1,STATION
372 BULLFROG,Bullfrog,36.88108,-116.81797,,
373 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
374
375
376
377 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,
378 BULLFROG,Bullfrog,36.868446,-116.784582,,
379 BULLFROG_ST,Bullfrog,36.868446,-116.784582,1,
380 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
381
382
383
384 BULLFROG_ST,Bullfrog,36.880,-116.817,1,
385 BEATTY_AIRPORT,Airport,36.880,-116.816,,BULLFROG_ST
386 BULLFROG,Bullfrog,36.881,-116.818,,BULLFROG_ST
387 STAGECOACH,Stagecoach,36.915,-116.751,,BULLFROG_ST
388
389 
390
391 BEATTY_AIRPORT, ,Airport,36.868446,-116.784582, , ,
392 BULLFROG,,Bullfrog,36.88108,-116.81797,,,
393 STAGECOACH,,Stagecoach Hotel,36.915682,-116.751677,,,
394 (RRRUR@R=R:RM(RRA((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyttestFieldsWithSpacefs
395
396
397
398
399
400
401
402
403
404
405
406
407 BEATTY_AIRPORT,Airport,48.20000,140
408 BULLFROG,Bullfrog,48.20001,140
409 STAGECOACH,Stagecoach Hotel,48.20016,140
410
411
412 BEATTY_AIRPORT,Airport,48.20000,140
413 BULLFROG,Bullfrog,48.20002,140
414 STAGECOACH,Stagecoach Hotel,48.20016,140
415
416
417 BEATTY_AIRPORT,Airport,48.2,140
418 BULLFROG,Bullfrog,48.2,140
419 STAGECOACH,Stagecoach Hotel,48.20016,140
420
421
422 BEATTY_AIRPORT,Airport,48.20000,140,,BEATTY_AIRPORT_STATION
423 BULLFROG,Bullfrog,48.20003,140,,BULLFROG_STATION
424 BEATTY_AIRPORT_STATION,Airport,48.20001,140,1,
425 BULLFROG_STATION,Bullfrog,48.20002,140,1,
426 STAGECOACH,Stagecoach Hotel,48.20016,140,,
427
428
429
430 BEATTY_AIRPORT,Airport,48.20000,140,,
431 BULLFROG,Bullfrog,48.20005,140,,
432 BULLFROG_STATION,Bullfrog,48.20006,140,1,
433 STAGECOACH,Stagecoach Hotel,48.20016,140,,
434
435
436
437 BEATTY_AIRPORT,Airport,0x20,140.00
438 BULLFROG,Bullfrog,48.20001,140.0123
439 STAGECOACH,Stagecoach Hotel,48.002,bogus
440
441
442 BEATTY_AIRPORT,Airport,36.868446,-116.784582,,STATION
443 STATION,Airport,36.868446,-116.784582,1,
444 BULLFROG,Bullfrog,36.88108,-116.81797,,
445 STAGECOACH,Stagecoach Hotel,36.915682,-116.751677,,
446
447
448
449
450
451 s<Extra columns loaded from a file are preserved when writing.s
452
453 AB,DTA,,Airport Bullfrog,3,,
454 t,DTA,T,,3,foo,
455 n,DTA,N,,3,,bar
456 RR0R:R;RRN(sExpirationDatesUnrecognizedColumn(
457
458
459 
460
461
462
463
464
465
466  
467  
468   
469   
470   
471
472
473
474
475
476
477
478
479
480
481
482
483
484  
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501                    
502
503
504
505
506
507
508 2007-01-01t20070229s
509 2007/12/31t20060101t2007Rt
510 field_listt
511
512
513     
514
515
516
517
518
519
520
521
522
523 dddt d d
524
525
526 dddt d d
527
528
529 dt d d
530
531
532 dt d d
533
534
535
536
537
538
539 dddt d d
540
541
542 dt d d
543
544
545 dt d d
546
547
548 dddt d d
549
550
551 dt d d
552
553
554 dt d d
555
556
557
558 %%%% 
559
560
561
562
563 t dd d
564
565
566
567
568 s.          
569 
570
571
572
573
574
575
576
577
578
579
580
581 S( s<Extra columns loaded from a file are preserved when writing.s trips.txtsLroute_id,service_id,trip_id,t_foo,n_foo
582 AB,FULLW,AB1,foo,
583 AB,FULLW,AB2,,bar
584 sstop_times.txtsDAB2,09:00:00,09:00:00,BULLFROG,1
585 AB2,09:30:00,09:30:00,STAGECOACH,2
586
587
588
589
590
591
592   
593   
594         
595                 
596  
597  
598  
599  
600 (RRRB(((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pyRm^
601
602
603
604
605
606
607
608 ti ddd d
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640 |i|
641
642
643
644
645
646
647
648 |i |
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672 
673   
674
675
676
677
678
679
680 d
681
682
683 UnusedStops OtherProblem( RRR<R
684
685
686
687
688
689 FULLW,20100604,1
690 FULLW,20100604,2
691
692
693
694
695
696 |i|
697
698
699 |i|
700
701 
702 
703 
704 
705
706
707 
708 
709 
710 
711
712 FULLW,1,1,1,1,1,1,1,20070101,20101232
713 WE,0,0,0,0,0,1,1,20070101,20101231
714
715 FULLW,1,1,1,1,1,1,1,200701xx,20101231
716 WE,0,0,0,0,0,1,1,20070101,20101231
717
718
719 See http://code.google.com/p/googletransitdatafeed/issues/detail?id=41
720
721 FULLW,1,1,1,1,1,1,1, ,
722 WE,0,0,0,0,0,1,1,20070101,20101231
723
724
725
726 FULLW,1,1,1,1,1,1,1,,abc
727 WE,0,0,0,0,0,1,1,20070101,20101231
728
729 FULLW,1,1,1,1,1,1,1,20070101
730 WE,0,0,0,0,0,1,1,20070101
731
732
733
734
735
736
737
738
739
740       
741        
742
743 Subclass of TestCase which sets self.tempfilepath to a valid temporary zip
744 file name and removes the file if it exists when the test is done.
745
746 This test case simply constructs an incomplete feed with very few
747 fields set and ensures that there are no exceptions when writing it out.
748
749 This is very similar to TransitFeedSampleCodeTestCase below, but that one
750 will no doubt change as the sample code is altered.
751
752
753
754
755 This test should simply contain the sample code printed on the page:
756 http://code.google.com/p/googletransitdatafeed/wiki/TransitFeed
757 to ensure that it doesn't cause any exceptions.
758
759 d
760
761
762
763 o/}|i
764
765
766
767 o/}|i
768
769
770   
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789 
790 
791 
792
793
794 ddd d
795
796
797
798
799
800
801
802
803
804
805
806 padding on the hour. IE 08:45:00 vs 8:45:00.it:R,N(RJ(RRR((sE/home/anog/workspace/transitfeed-1.2.5/python/test/testtransitfeed.pytassertEqualTimeString5s
807
808
809
810 } | i|
811
812
813
814 WqV
815
816
817
818
819
820
821
822 to AirportR0RN(sSTBAR%sSTBAR2NNN(RR%sCITY1NR,NN(RR%R3NR0NN(RR%R4sto Furnace Creek ResortR,R0R$(RR%R5s to BullfrogR0RN(R"R'R6sto Amargosa ValleyR,NN(R"R'R7s
823 to AirportR0NN(R"R'R8sto Amargosa ValleyR,NN(R"R'R9s
824 to AirportR0NN(s6:00:00s6:00:00s
825 STAGECOACHNNNN(s6:20:00s6:20:00sBEATTY_AIRPORTNNNN(s6:00:00s6:00:00s
826 STAGECOACHgq=
827
828
829 route_datat route_entryR9t
830 shape_dataRRRt week_periodtweekend_periodR t stop_datat
831
832
833
834 
835      
836    *   0             && 
837      
838 
839 "   " "     "    
840 
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857 |idddd d
858
859
860
861
862
863
864
865
866
867
868 t
869
870
871
872
873
874
875
876
877
878
879
880 ddd d
881
882 dd d d
883
884 ddd d
885
886 ddd d
887
888 ddd d
889
890
891
892
893 gd
894
895
896
897 |
898 djo&|it ||
899
900
901
902
903
904 FULLW,1,1,1,1,1,1,1,20090601,20090610
905 WE,0,0,0,0,0,1,1,20090718,20101231
906
907 WE,20090815,2
908 WE,20090816,2
909 WE,20090822,2
910 WE,20090829,2
911 WE,20090830,2
912 WE,20100102,2
913 WE,20100103,2
914 WE,20100109,2
915 WE,20100110,2
916 WE,20100612,2
917 WE,20100613,2
918 WE,20100619,2
919 WE,20100620,2
920 s trips.txts3route_id,service_id,trip_id
921 AB,WE,AB1
922 AB,FULLW,AB2
923
924 AB1,10:00:00,10:00:00,BEATTY_AIRPORT,1
925 AB1,10:20:00,10:20:00,BULLFROG,2
926 AB2,10:25:00,10:25:00,STAGECOACH,1
927 AB2,10:55:00,10:55:00,BULLFROG,2
928
929
930 
931
932
933
934
935 
936
937
938 
939
940
941 
942
943
944
945 
946 
947 
948  
949
950
951
952 v
953    
954   *  
955 
956  
957
958