@@ -79,14 +79,19 @@ def test_missing_coords_are_skipped(self):
7979 stops_path = csv_cache .get_path ("stops.txt" )
8080
8181 with open (stops_path , "w" , encoding = "utf-8" ) as f :
82- f .write ("stop_id,stop_lon,stop_lat,stop_name\n " )
83- # stop without coordinates
84- f .write ("stop_missing,,,NoCoords\n " )
85- f .write ("stop_ok,-73.2,45.2,OK\n " )
82+ f .write ("stop_id,stop_lon,stop_lat,stop_name,location_type\n " )
83+ # two stops without coordinates: one optional (3), one required (1)
84+ f .write ("stop_missing_type3,,,Node,3\n " )
85+ f .write ("stop_missing_type1,,,Station,1\n " )
86+ f .write ("stop_ok,-73.2,45.2,OK,0\n " )
8687
8788 routes_colors = DummyRoutesProcessorForColors ({"r1" : "FF0000" })
8889 stop_times = DummyStopTimesProcessor (
89- {"stop_missing" : {"r1" }, "stop_ok" : {"r1" }}
90+ {
91+ "stop_missing_type3" : {"r1" },
92+ "stop_missing_type1" : {"r1" },
93+ "stop_ok" : {"r1" },
94+ }
9095 )
9196
9297 processor = StopsProcessor (
@@ -108,7 +113,8 @@ def test_missing_coords_are_skipped(self):
108113 # only stop_ok should be present
109114 ids = [f .get ("properties" , {}).get ("stop_id" ) for f in features ]
110115 self .assertIn ("stop_ok" , ids )
111- self .assertNotIn ("stop_missing" , ids )
116+ self .assertNotIn ("stop_missing_type3" , ids )
117+ self .assertNotIn ("stop_missing_type1" , ids )
112118
113119
114120if __name__ == "__main__" :
0 commit comments