Skip to content

Commit

Permalink
feat(SpeedTripValidatorTest): first attempt to write test for duplica…
Browse files Browse the repository at this point in the history
…te arrival_time
  • Loading branch information
josh-willis-arcadis committed Nov 12, 2024
1 parent 9d9db26 commit d930b01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import static com.conveyal.gtfs.GTFS.load;
import static com.conveyal.gtfs.GTFS.validate;
import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount;
import static com.conveyal.gtfs.error.NewGTFSErrorType.TRAVEL_TOO_FAST;
import static com.conveyal.gtfs.error.NewGTFSErrorType.TRAVEL_TOO_SLOW;
import static com.conveyal.gtfs.error.NewGTFSErrorType.*;

/**
* Distances recorded against each unit test have been produced using the lat/lon values from
Expand Down Expand Up @@ -112,6 +111,9 @@ public void tripTravelingTooSlowWithMissingStopTimesHasError() {
checkFeedHasError(TRAVEL_TOO_SLOW, "6", 3);
}

@Test
public void tripHasDuplicateArrivalTimesHasError(){checkFeedHasError(INVALID_ARRIVAL_TIME,"7",2);}

/**
* Check that the test feed has exactly one error for the given type, entityId, and entitySequence.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_t
5,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
6,00:00:00,00:00:00,4957,1,,0,0,,1
6,,,1558,2,,0,0,8.34879971,0
6,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
6,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
7,18000,18000,4957,1,,0,0,,0
7,18000,18000,1558,2,,0,0,8.34879971,0
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,
23,1,4,PALO ALTO TRANSIT CTR 4,,1,2145,101395,0,0
23,1,5,PALO ALTO TRANSIT CTR 5,,1,2145,101395,0,0
23,1,6,PALO ALTO TRANSIT CTR 6,,1,2145,101395,0,0
23,1,7,PALO ALTO TRANSIT CTR 7,,1,2145,101395,0,0

0 comments on commit d930b01

Please sign in to comment.