Skip to content

Commit adfa977

Browse files
committed
fix(realtime): correct protobuf serialization to generate .pb fixtures (#14)
1 parent 616acd6 commit adfa977

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

feed/files/trip_updates_bytewax.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
"header": {
33
"gtfs_realtime_version": "2.0",
44
"incrementality": "FULL_DATASET",
5-
"timestamp": 1762132640
5+
"timestamp": 1763932780
66
},
77
"entity": [
88
{
99
"id": "trip_FAKE_TRIP_001",
1010
"trip_update": {
11-
"timestamp": 1762132640,
11+
"timestamp": 1763932780,
1212
"trip": {
1313
"trip_id": "FAKE_TRIP_001",
1414
"route_id": "FAKE_ROUTE_1",
1515
"direction_id": 0,
16-
"start_time": "01:17:20",
17-
"start_date": "20251103",
16+
"start_time": "21:19:40",
17+
"start_date": "20251123",
1818
"schedule_relationship": "SCHEDULED"
1919
},
2020
"vehicle": {
@@ -26,19 +26,19 @@
2626
{
2727
"stop_id": "STOP_A",
2828
"arrival": {
29-
"time": 1762132702
29+
"time": 1763932949
3030
}
3131
},
3232
{
3333
"stop_id": "STOP_B",
3434
"arrival": {
35-
"time": 1762132749
35+
"time": 1763932870
3636
}
3737
},
3838
{
3939
"stop_id": "STOP_C",
4040
"arrival": {
41-
"time": 1762132867
41+
"time": 1763932995
4242
}
4343
}
4444
]

feed/files/trip_updates_bytewax.pb

0 Bytes
Binary file not shown.

tests/test_realtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def save_sample_binaries():
214214
entity.alert.header_text.translation.add(text="Sample Alert")
215215
entity.alert.informed_entity.add().route_id = "R001"
216216

217-
with open(f"tests/data/{sample}.bin", "wb") as f:
217+
with open(f"tests/data/{sample}.pb", "wb") as f:
218218
f.write(feed.SerializeToString())
219219

220220
print("Sample GTFS-RT binaries written to tests/data/")

0 commit comments

Comments
 (0)