@@ -90,13 +90,13 @@ def test_geojson_live():
9090 "response,slots_available,slots_running,slots_waiting" ,
9191 [
9292 (
93- "tests/overpass_status/no_slots_waiting.txt" ,
93+ Path ( "tests/overpass_status/no_slots_waiting.txt" ) ,
9494 2 ,
9595 (),
9696 ()
9797 ),
9898 (
99- "tests/overpass_status/one_slot_running.txt" ,
99+ Path ( "tests/overpass_status/one_slot_running.txt" ) ,
100100 1 ,
101101 (
102102 datetime (
@@ -112,7 +112,7 @@ def test_geojson_live():
112112 ()
113113 ),
114114 (
115- "tests/overpass_status/one_slot_waiting.txt" ,
115+ Path ( "tests/overpass_status/one_slot_waiting.txt" ) ,
116116 1 ,
117117 (),
118118 (
@@ -128,7 +128,7 @@ def test_geojson_live():
128128 )
129129 ),
130130 (
131- "tests/overpass_status/two_slots_waiting.txt" ,
131+ Path ( "tests/overpass_status/two_slots_waiting.txt" ) ,
132132 0 ,
133133 (),
134134 (
@@ -154,9 +154,8 @@ def test_geojson_live():
154154 ),
155155 ]
156156)
157- def test_api_status (response , slots_available , slots_running , slots_waiting , requests_mock ):
158- with open (response ) as fp :
159- mock_response = fp .read ()
157+ def test_api_status (response : Path , slots_available : int , slots_running : tuple [datetime ], slots_waiting : tuple [datetime ], requests_mock ):
158+ mock_response = response .read_text ()
160159 requests_mock .get ("https://overpass-api.de/api/status" , text = mock_response )
161160
162161 api = overpass .API (debug = True )
@@ -175,3 +174,8 @@ def test_api_status(response, slots_available, slots_running, slots_waiting, req
175174
176175 assert isinstance (api .slots_waiting , tuple )
177176 assert api .slots_waiting == slots_waiting
177+
178+ assert isinstance (api .slot_available_countdown , int )
179+ assert api .slot_available_countdown >= 0
180+
181+ assert api .slot_available_datetime is None or isinstance (api .slot_available_datetime , datetime )
0 commit comments