@@ -52,26 +52,26 @@ def test_rt_file_processing_outcome_construction() -> None:
52
52
)
53
53
54
54
55
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
55
56
def test_vehicle_positions ():
56
- base64url = "aHR0cHM6Ly9tdnNodXR0bGUucmlkZXN5c3RlbXMubmV0L3N1YnNjcmlwdGlvbnMvZ3Rmc3J0L3ZlaGljbGVzLmFzaHg="
57
57
result = runner .invoke (
58
58
app ,
59
- ["parse" , "vehicle_positions" , "2024 -10-22T18:00:00" , "--base64url" , base64url ],
59
+ ["parse" , "vehicle_positions" , "1999 -10-22T18:00:00" ],
60
60
catch_exceptions = False ,
61
61
)
62
62
assert result .exit_code == 0
63
63
assert (
64
- "test-calitp-gtfs-rt-raw-v2/vehicle_positions/dt=2024 -10-22/hour=2024 -10-22T18:00:00+00:00"
64
+ "test-calitp-gtfs-rt-raw-v2/vehicle_positions/dt=1999 -10-22/hour=1999 -10-22T18:00:00+00:00"
65
65
in result .stdout
66
66
)
67
- assert "4786 vehicle_positions files in 139 aggregations" in result .stdout
67
+ assert "1 vehicle_positions files in 1 aggregations" in result .stdout
68
68
69
- assert f"url filter applied, only processing { base64url } " in result .stdout
70
- assert "writing 28 lines" in result .stdout
69
+ assert "writing 1 lines" in result .stdout
71
70
assert "test-calitp-gtfs-rt-parsed" in result .stdout
72
- assert "saving 40 outcomes" in result .stdout
71
+ assert "saving 1 outcomes" in result .stdout
73
72
74
73
74
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
75
75
def test_no_vehicle_positions_for_date ():
76
76
base64url = (
77
77
"aHR0cHM6Ly9hcGkuNTExLm9yZy90cmFuc2l0L3ZlaGljbGVwb3NpdGlvbnM_YWdlbmN5PVNJ"
@@ -87,6 +87,7 @@ def test_no_vehicle_positions_for_date():
87
87
assert "outcomes" not in result .stdout
88
88
89
89
90
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
90
91
def test_no_vehicle_positions_for_url ():
91
92
result = runner .invoke (
92
93
app ,
@@ -99,6 +100,7 @@ def test_no_vehicle_positions_for_url():
99
100
assert "outcomes" not in result .stdout
100
101
101
102
103
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
102
104
def test_no_records_for_url_vehicle_positions_on_date ():
103
105
base64url = (
104
106
"aHR0cHM6Ly9hcGkuNTExLm9yZy90cmFuc2l0L3ZlaGljbGVwb3NpdGlvbnM_YWdlbmN5PVNJ"
@@ -115,6 +117,7 @@ def test_no_records_for_url_vehicle_positions_on_date():
115
117
assert "saving 38 outcomes" in result .stdout
116
118
117
119
120
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
118
121
def test_trip_updates ():
119
122
base64url = "aHR0cHM6Ly9hcGkuNTExLm9yZy90cmFuc2l0L3RyaXB1cGRhdGVzP2FnZW5jeT1TQQ=="
120
123
result = runner .invoke (
@@ -135,6 +138,7 @@ def test_trip_updates():
135
138
assert "saving 49 outcomes" in result .stdout
136
139
137
140
141
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
138
142
def test_service_alerts ():
139
143
base64url = "aHR0cHM6Ly9hcGkuNTExLm9yZy90cmFuc2l0L3NlcnZpY2VhbGVydHM_YWdlbmN5PUFN"
140
144
result = runner .invoke (
@@ -155,6 +159,7 @@ def test_service_alerts():
155
159
assert "saving 30 outcomes" in result .stdout
156
160
157
161
162
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
158
163
def test_validation ():
159
164
base64url = "aHR0cHM6Ly9hcGkuZ29zd2lmdC5seS9yZWFsLXRpbWUvbWVuZG9jaW5vL2d0ZnMtcnQtdHJpcC11cGRhdGVz"
160
165
result = runner .invoke (
@@ -175,6 +180,7 @@ def test_validation():
175
180
assert "saving 30 outcomes" in result .stdout
176
181
177
182
183
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
178
184
def test_no_recent_schedule_for_vehicle_positions_on_validation ():
179
185
base64url = (
180
186
"aHR0cHM6Ly9hcGkuNTExLm9yZy90cmFuc2l0L3ZlaGljbGVwb3NpdGlvbnM_YWdlbmN5PVNJ"
@@ -202,8 +208,8 @@ def test_no_recent_schedule_for_vehicle_positions_on_validation():
202
208
assert "saving 38 outcomes" in result .stdout
203
209
204
210
211
+ @pytest .mark .skipif ("not config.getoption('--gcs')" , reason = "requires GCS credentials" )
205
212
def test_no_output_file_for_vehicle_positions_on_validation ():
206
- # "WARNING: no validation output file found" generates the log "[Errno 2] No such file or directory"
207
213
result = runner .invoke (
208
214
app ,
209
215
[
@@ -216,12 +222,14 @@ def test_no_output_file_for_vehicle_positions_on_validation():
216
222
],
217
223
catch_exceptions = True ,
218
224
)
225
+ print (result .stdout )
219
226
assert result .exit_code == 0
220
227
assert (
221
228
"test-calitp-gtfs-rt-raw-v2/vehicle_positions/dt=2024-10-17/hour=2024-10-17T00:00:00+00:00"
222
229
in result .stdout
223
230
)
224
231
assert "5487 vehicle_positions files in 139 aggregations" in result .stdout
225
232
assert "limit of 3 feeds was set" in result .stdout
233
+ # "WARNING: no validation output file found" was previously generating the error "[Errno 2] No such file or directory"
226
234
assert "WARNING: no validation output file found" in result .stdout
227
235
assert "saving 122 outcomes" in result .stdout
0 commit comments