<s> from __future__ import absolute_import <EOL> import datetime <EOL> import feedvalidator <EOL> import os . path <EOL> import re <EOL> import StringIO <EOL> from tests import util <EOL> import transitfeed <EOL> import unittest <EOL> from urllib2 import HTTPError , URLError <EOL> import urllib2 <EOL> import zipfile <EOL> class FullTests ( util . TempDirTestCaseBase ) : <EOL> feedvalidator_executable = '<STR_LIT>' <EOL> extension_message = '<STR_LIT>' <EOL> extension_name = '<STR_LIT:None>' <EOL> additional_arguments = [ ] <EOL> def testGoodFeed ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testGoodFeedConsoleOutput ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ '<STR_LIT>' , self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , out ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testMissingStops ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testMissingStopsConsoleOutput ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , transitfeed . __version__ ] + <EOL> self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , out ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testLimitedErrors ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT:2>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , transitfeed . __version__ ] + <EOL> self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertEquals ( <NUM_LIT:2> , len ( re . findall ( r'<STR_LIT>' , htmlout ) ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testBadDateFormat ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testBadUtf8 ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testFileNotFound ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ , '<STR_LIT>' ] , <EOL> expected_retcode = <NUM_LIT:1> ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testBadOutputPath ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ , '<STR_LIT>' , '<STR_LIT>' , <EOL> self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] , <EOL> expected_retcode = <NUM_LIT:2> ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testCrashHandler ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> transitfeed . __version__ ] + self . additional_arguments + <EOL> [ '<STR_LIT>' ] , <EOL> expected_retcode = <NUM_LIT> ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , out ) ) <EOL> crashout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , <EOL> crashout ) ) <EOL> def testCheckVersionIsRun ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> htmlout = open ( '<STR_LIT>' ) . read ( ) <EOL> self . assertMatchesRegex ( <EOL> self . extension_message + self . extension_name , htmlout ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( re . search ( r'<STR_LIT>' , htmlout ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testCheckVersionIsRunConsoleOutput ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] + self . additional_arguments + <EOL> [ self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) ] ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertTrue ( re . search ( r'<STR_LIT>' , out ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> def testUsage ( self ) : <EOL> ( out , err ) = self . CheckCallWithPath ( <EOL> [ self . GetPath ( self . feedvalidator_executable ) , '<STR_LIT>' ] , <EOL> expected_retcode = <NUM_LIT:2> ) <EOL> self . assertMatchesRegex ( r'<STR_LIT>' , err ) <EOL> self . assertMatchesRegex ( r'<STR_LIT>' , err ) <EOL> self . assertMatchesRegex ( r'<STR_LIT>' , err ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( os . path . exists ( '<STR_LIT>' ) ) <EOL> class CalendarSummaryTestCase ( util . TestCase ) : <EOL> def testFutureFeedDoesNotCrashCalendarSummary ( self ) : <EOL> today = datetime . date . today ( ) <EOL> start_date = today + datetime . timedelta ( days = <NUM_LIT:20> ) <EOL> end_date = today + datetime . timedelta ( days = <NUM_LIT> ) <EOL> schedule = transitfeed . Schedule ( ) <EOL> service_period = schedule . GetDefaultServicePeriod ( ) <EOL> service_period . SetStartDate ( start_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetEndDate ( end_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetWeekdayService ( True ) <EOL> result = feedvalidator . CalendarSummary ( schedule ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertTrue ( re . search ( "<STR_LIT>" , result [ '<STR_LIT>' ] ) ) <EOL> def testShortFeedDoesNotCrashCalendarSummary ( self ) : <EOL> start_date = datetime . date . today ( ) <EOL> end_date = start_date + datetime . timedelta ( days = <NUM_LIT:15> ) <EOL> schedule = transitfeed . Schedule ( ) <EOL> service_period = schedule . GetDefaultServicePeriod ( ) <EOL> service_period . SetStartDate ( start_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetEndDate ( end_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetWeekdayService ( True ) <EOL> result = feedvalidator . CalendarSummary ( schedule ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertTrue ( re . search ( "<STR_LIT>" , result [ '<STR_LIT>' ] ) ) <EOL> def testFutureAndShortFeedDoesNotCrashCalendarSummary ( self ) : <EOL> today = datetime . date . today ( ) <EOL> start_date = today + datetime . timedelta ( days = <NUM_LIT:2> ) <EOL> end_date = today + datetime . timedelta ( days = <NUM_LIT:3> ) <EOL> schedule = transitfeed . Schedule ( ) <EOL> service_period = schedule . GetDefaultServicePeriod ( ) <EOL> service_period . SetStartDate ( start_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetEndDate ( end_date . strftime ( "<STR_LIT>" ) ) <EOL> service_period . SetWeekdayService ( True ) <EOL> result = feedvalidator . CalendarSummary ( schedule ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertEquals ( <NUM_LIT:0> , result [ '<STR_LIT>' ] ) <EOL> self . assertTrue ( re . search ( "<STR_LIT>" , result [ '<STR_LIT>' ] ) ) <EOL> def testFeedWithNoDaysDoesNotCrashCalendarSummary ( self ) : <EOL> schedule = transitfeed . Schedule ( ) <EOL> result = feedvalidator . CalendarSummary ( schedule ) <EOL> self . assertEquals ( { } , result ) <EOL> class MockOptions : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . limit_per_type = <NUM_LIT:5> <EOL> self . memory_db = True <EOL> self . check_duplicate_trips = True <EOL> self . latest_version = transitfeed . __version__ <EOL> self . output = '<STR_LIT>' <EOL> self . manual_entry = False <EOL> self . service_gap_interval = None <EOL> self . extension = None <EOL> self . error_types_ignore_list = None <EOL> class FeedValidatorTestCase ( util . TempDirTestCaseBase ) : <EOL> def testBadEolContext ( self ) : <EOL> """<STR_LIT>""" <EOL> filename = "<STR_LIT>" <EOL> old_zip = zipfile . ZipFile ( <EOL> self . GetPath ( '<STR_LIT>' , '<STR_LIT:data>' , '<STR_LIT>' ) , '<STR_LIT:r>' ) <EOL> content_dict = self . ConvertZipToDict ( old_zip ) <EOL> old_routes = content_dict [ filename ] <EOL> new_routes = old_routes . replace ( '<STR_LIT:\n>' , '<STR_LIT:\r\n>' , <NUM_LIT:1> ) <EOL> self . assertNotEquals ( old_routes , new_routes ) <EOL> content_dict [ filename ] = new_routes <EOL> new_zipfile_mem = self . ConvertDictToZip ( content_dict ) <EOL> options = MockOptions ( ) <EOL> output_file = StringIO . StringIO ( ) <EOL> feedvalidator . RunValidationOutputToFile ( <EOL> new_zipfile_mem , options , output_file ) <EOL> self . assertMatchesRegex ( filename , output_file . getvalue ( ) ) <EOL> class LimitPerTypeProblemReporterTestCase ( util . TestCase ) : <EOL> def CreateLimitPerTypeProblemReporter ( self , limit ) : <EOL> accumulator = feedvalidator . LimitPerTypeProblemAccumulator ( limit ) <EOL> problems = transitfeed . ProblemReporter ( accumulator ) <EOL> return problems <EOL> def assertProblemsAttribute ( self , problem_type , class_name , attribute_name , <EOL> expected ) : <EOL> """<STR_LIT>""" <EOL> problem_attribute_list = [ ] <EOL> for e in self . problems . GetAccumulator ( ) . ProblemList ( <EOL> problem_type , class_name ) . problems : <EOL> problem_attribute_list . append ( getattr ( e , attribute_name ) ) <EOL> self . assertEquals ( expected , "<STR_LIT:U+0020>" . join ( problem_attribute_list ) ) <EOL> def testLimitOtherProblems ( self ) : <EOL> """<STR_LIT>""" <EOL> self . problems = self . CreateLimitPerTypeProblemReporter ( <NUM_LIT:2> ) <EOL> self . accumulator = self . problems . GetAccumulator ( ) <EOL> self . problems . OtherProblem ( "<STR_LIT>" , type = transitfeed . TYPE_ERROR ) <EOL> self . problems . OtherProblem ( "<STR_LIT>" , type = transitfeed . TYPE_WARNING ) <EOL> self . problems . OtherProblem ( "<STR_LIT>" , type = transitfeed . TYPE_ERROR ) <EOL> self . problems . OtherProblem ( "<STR_LIT>" , type = transitfeed . TYPE_ERROR ) <EOL> self . problems . OtherProblem ( "<STR_LIT>" , type = transitfeed . TYPE_WARNING ) <EOL> self . assertEquals ( <NUM_LIT:2> , self . accumulator . WarningCount ( ) ) <EOL> self . assertEquals ( <NUM_LIT:3> , self . accumulator . ErrorCount ( ) ) <EOL> warning_bounded_list = self . accumulator . ProblemList ( <EOL> transitfeed . TYPE_WARNING , "<STR_LIT>" ) <EOL> error_bounded_list = self . accumulator . ProblemList ( <EOL> transitfeed . TYPE_ERROR , "<STR_LIT>" ) <EOL> self . assertEquals ( <NUM_LIT:2> , warning_bounded_list . count ) <EOL> self . assertEquals ( <NUM_LIT:3> , error_bounded_list . count ) <EOL> self . assertEquals ( <NUM_LIT:0> , warning_bounded_list . dropped_count ) <EOL> self . assertEquals ( <NUM_LIT:1> , error_bounded_list . dropped_count ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_ERROR , "<STR_LIT>" , <EOL> "<STR_LIT:description>" , "<STR_LIT>" ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_WARNING , "<STR_LIT>" , <EOL> "<STR_LIT:description>" , "<STR_LIT>" ) <EOL> def testKeepUnsorted ( self ) : <EOL> """<STR_LIT>""" <EOL> exceptions = [ ] <EOL> for i in range ( <NUM_LIT:20> ) : <EOL> exceptions . append ( transitfeed . OtherProblem ( description = "<STR_LIT>" % i ) ) <EOL> exceptions = exceptions [ <NUM_LIT:10> : ] + exceptions [ : <NUM_LIT:10> ] <EOL> self . problems = self . CreateLimitPerTypeProblemReporter ( <NUM_LIT:3> ) <EOL> self . accumulator = self . problems . GetAccumulator ( ) <EOL> for e in exceptions : <EOL> self . problems . AddToAccumulator ( e ) <EOL> self . assertEquals ( <NUM_LIT:0> , self . accumulator . WarningCount ( ) ) <EOL> self . assertEquals ( <NUM_LIT:20> , self . accumulator . ErrorCount ( ) ) <EOL> bounded_list = self . accumulator . ProblemList ( <EOL> transitfeed . TYPE_ERROR , "<STR_LIT>" ) <EOL> self . assertEquals ( <NUM_LIT:20> , bounded_list . count ) <EOL> self . assertEquals ( <NUM_LIT> , bounded_list . dropped_count ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_ERROR , "<STR_LIT>" , <EOL> "<STR_LIT:description>" , "<STR_LIT>" ) <EOL> def testLimitSortedTooFastTravel ( self ) : <EOL> """<STR_LIT>""" <EOL> self . problems = self . CreateLimitPerTypeProblemReporter ( <NUM_LIT:3> ) <EOL> self . accumulator = self . problems . GetAccumulator ( ) <EOL> self . problems . TooFastTravel ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:5> , <EOL> None ) <EOL> self . problems . TooFastTravel ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:5> , None ) <EOL> self . problems . TooFastTravel ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:5> , None ) <EOL> self . problems . TooFastTravel ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:5> , None ) <EOL> self . assertEquals ( <NUM_LIT:0> , self . accumulator . WarningCount ( ) ) <EOL> self . assertEquals ( <NUM_LIT:4> , self . accumulator . ErrorCount ( ) ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_ERROR , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ) <EOL> def testLimitSortedStopTooFarFromParentStation ( self ) : <EOL> """<STR_LIT>""" <EOL> self . problems = self . CreateLimitPerTypeProblemReporter ( <NUM_LIT:3> ) <EOL> self . accumulator = self . problems . GetAccumulator ( ) <EOL> for i , distance in enumerate ( ( <NUM_LIT:1000> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) : <EOL> self . problems . StopTooFarFromParentStation ( <EOL> "<STR_LIT>" % i , "<STR_LIT>" % i , "<STR_LIT>" % i , "<STR_LIT>" % i , distance ) <EOL> self . assertEquals ( <NUM_LIT:5> , self . accumulator . WarningCount ( ) ) <EOL> self . assertEquals ( <NUM_LIT:0> , self . accumulator . ErrorCount ( ) ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_WARNING , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def testLimitSortedStopsTooClose ( self ) : <EOL> """<STR_LIT>""" <EOL> self . problems = self . CreateLimitPerTypeProblemReporter ( <NUM_LIT:3> ) <EOL> self . accumulator = self . problems . GetAccumulator ( ) <EOL> for i , distance in enumerate ( ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.0> , <NUM_LIT:0.0> ) ) : <EOL> self . problems . StopsTooClose ( <EOL> "<STR_LIT>" % i , "<STR_LIT>" % i , "<STR_LIT>" % i , "<STR_LIT>" % i , distance ) <EOL> self . assertEquals ( <NUM_LIT:6> , self . accumulator . WarningCount ( ) ) <EOL> self . assertEquals ( <NUM_LIT:0> , self . accumulator . ErrorCount ( ) ) <EOL> self . assertProblemsAttribute ( transitfeed . TYPE_WARNING , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
