Skip to content

Commit

Permalink
Make all tests green
Browse files Browse the repository at this point in the history
  • Loading branch information
gbastkowski committed Jun 24, 2024
1 parent 40a7504 commit a7b04ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
31 changes: 11 additions & 20 deletions core/src/main/scala/com/mobimeo/gtfs/model/StopTime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,20 @@
package com.mobimeo.gtfs
package model

import fs2.data.csv._
import fs2.data.csv.*
import fs2.data.csv.generic.CsvName
import fs2.data.csv.generic.semiauto._
import fs2.data.csv.generic.semiauto.*

case class StopTime(
@CsvName("trip_id")
tripId: String,
@CsvName("arrival_time")
arrivalTime: SecondsSinceMidnight,
@CsvName("departure_time")
departureTime: SecondsSinceMidnight,
@CsvName("stop_id")
stopId: String,
@CsvName("stop_sequence")
stopSequence: Int,
@CsvName("stop_headsign")
stopHeadsign: Option[String],
@CsvName("pickup_type")
pickupType: Option[PickupOrDropOffType],
@CsvName("drop_off_type")
dropOffType: Option[PickupOrDropOffType],
@CsvName("shape_dist_traveled")
shapeDistTraveled: Option[Double],
@CsvName("trip_id") tripId: String,
@CsvName("arrival_time") arrivalTime: SecondsSinceMidnight,
@CsvName("departure_time") departureTime: SecondsSinceMidnight,
@CsvName("stop_id") stopId: String,
@CsvName("stop_sequence") stopSequence: Int,
@CsvName("stop_headsign") stopHeadsign: Option[String],
@CsvName("pickup_type") pickupType: Option[PickupOrDropOffType],
@CsvName("drop_off_type") dropOffType: Option[PickupOrDropOffType],
@CsvName("shape_dist_traveled") shapeDistTraveled: Option[Double],
timepoint: Option[Timepoint]
)

Expand Down
Binary file modified core/src/test/resources/com/mobimeo/gtfs/file/simple-gtfs.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions core/src/test/scala/com/mobimeo/gtfs/file/GtfsFileSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ object GtfsFileSpec extends IOSuite {
yield List(
expect(stopTimes.size == 12),
expect(stopTimes(0).tripId == "DE:1"),
expect(stopTimes(1).arrivalTime == LocalTime.of(18, 39, 0)),
expect(stopTimes(1).departureTime == LocalTime.of(18, 42, 0)),
expect(stopTimes(1).arrivalTime.toLocalTime == LocalTime.of(18, 39, 0)),
expect(stopTimes(1).departureTime.toLocalTime == LocalTime.of(18, 42, 0)),
expect(stopTimes(1).stopSequence == 2),
expect(stopTimes(1).stopId == "8070003"),
expect(stopTimes(1).stopHeadsign == "Bruxelles-Midi".some),
Expand Down

0 comments on commit a7b04ac

Please sign in to comment.