From 299ddf3df80860b5f874dcb35b2afc1358fa0b9c Mon Sep 17 00:00:00 2001 From: Brian Fauble Date: Thu, 19 Sep 2024 14:00:18 -0600 Subject: [PATCH] fix tests --- test/concentrate/group_filter/cancelled_trip_test.exs | 3 +++ test/support/filter/fakes.ex | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/concentrate/group_filter/cancelled_trip_test.exs b/test/concentrate/group_filter/cancelled_trip_test.exs index 2d5b31b1..78bdd00a 100644 --- a/test/concentrate/group_filter/cancelled_trip_test.exs +++ b/test/concentrate/group_filter/cancelled_trip_test.exs @@ -69,6 +69,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "cancels the group if all stop updates have already been given a skipped status" do td = TripDescriptor.new( + route_id: "1", trip_id: "trip", start_date: {1970, 1, 2} ) @@ -91,6 +92,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "does not cancel the group if all stop updates have already been given a skipped status but route_type is not 3" do td = TripDescriptor.new( + route_id: "Red", trip_id: "red_trip", start_date: {1970, 1, 2} ) @@ -113,6 +115,7 @@ defmodule Concentrate.GroupFilter.CancelledTripTest do test "does not cancel the group if only some stop updates have already been given a skipped schedule relationship" do td = TripDescriptor.new( + route_id: "86", trip_id: "trip", start_date: {1970, 1, 2} ) diff --git a/test/support/filter/fakes.ex b/test/support/filter/fakes.ex index d888ff23..4937dd7a 100644 --- a/test/support/filter/fakes.ex +++ b/test/support/filter/fakes.ex @@ -9,7 +9,13 @@ end defmodule Concentrate.GTFS.FakeRoutes do @moduledoc "Fake implementation of GTFS.Routes" - def route_type("trip"), do: 3 + def route_type(route_id) when is_binary(route_id) do + case Integer.parse(route_id) do + :error -> nil + _ -> 3 + end + end + def route_type(_), do: nil end