Skip to content

Commit 8d331bf

Browse files
committed
fix: tests
1 parent 9124cc5 commit 8d331bf

7 files changed

Lines changed: 14 additions & 1 deletion

File tree

api/tests/unittest/models/test_basic_feed_impl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
feed_name="feed_name",
9696
note="note",
9797
feed_contact_email="feed_contact_email",
98+
related_links=[],
9899
source_info=SourceInfo(
99100
producer_url="producer_url",
100101
authentication_type=1,
@@ -149,6 +150,7 @@ def test_from_orm_empty_fields(self):
149150
external_ids=[],
150151
redirects=[],
151152
source_info=SourceInfo(),
153+
related_links=[],
152154
)
153155
empty_result = FeedImpl.from_orm(empty_feed_orm)
154156
assert empty_result == expected_empty_feed

api/tests/unittest/models/test_gbfs_feed_impl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def test_from_orm_all_fields(self):
4949
expected = GbfsFeedImpl(
5050
id="feed_stable_1",
5151
system_id="sys1",
52+
related_links=[],
5253
data_type="gbfs",
5354
created_at=datetime(2024, 1, 1, 10, 0, 0),
5455
external_ids=[],
@@ -88,6 +89,7 @@ def test_from_orm_empty_fields(self):
8889
redirects=[],
8990
locations=[],
9091
versions=[],
92+
related_links=[],
9193
bounding_box=None,
9294
bounding_box_generated_at=None,
9395
source_info=SourceInfo(

api/tests/unittest/models/test_gtfs_feed_impl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def create_test_notice(notice_code: str, total_notices: int, severity: str):
134134
feed_name="feed_name",
135135
note="note",
136136
feed_contact_email="feed_contact_email",
137+
related_links=[],
137138
source_info=SourceInfo(
138139
producer_url="producer_url",
139140
authentication_type=1,
@@ -226,6 +227,7 @@ def test_from_orm_empty_fields(self):
226227
provider=None,
227228
feed_name="",
228229
note=None,
230+
related_links=[],
229231
feed_contact_email=None,
230232
source_info=SourceInfo(
231233
producer_url=None,

api/tests/unittest/models/test_gtfs_rt_feed_impl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
id="id",
6565
data_type="gtfs_rt",
6666
status="active",
67+
related_links=[],
6768
external_ids=[ExternalIdImpl(external_id="associated_id", source="source")],
6869
provider="provider",
6970
feed_name="feed_name",

api/tests/unittest/test_feeds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"producer_url": "test_producer_url",
7373
},
7474
external_ids=[{"external_id": "test_associated_id", "source": "test_source"}],
75+
related_links=[],
7576
redirects=[{"comment": "Some comment", "target_id": "test_target_id"}],
7677
).model_dump_json()
7778
)

functions-python/tasks_executor/src/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from tasks.geojson.update_geojson_files_precision import (
3939
update_geojson_files_precision_handler,
4040
)
41+
from tasks.jbda_import.import_jbda_feeds import import_jbda_handler
4142

4243
init_logger()
4344
LIST_COMMAND: Final[str] = "list"
@@ -77,6 +78,10 @@
7778
"description": "Rebuilds missing visualization files for GTFS datasets.",
7879
"handler": rebuild_missing_visualization_files_handler,
7980
},
81+
"jbda_import": {
82+
"description": "Imports JBDA data into the system.",
83+
"handler": import_jbda_handler,
84+
},
8085
}
8186

8287

functions-python/tasks_executor/tests/tasks/jbda_import/test_jbda_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class _FakeSessionOK:
5252
FEEDS_URL = "https://api.gtfs-data.jp/v2/feeds"
5353
DETAIL_TMPL = "https://api.gtfs-data.jp/v2/organizations/{org_id}/feeds/{feed_id}"
5454

55-
def get(self, url):
55+
def get(self, url, timeout=60):
5656
# feeds index
5757
if url == self.FEEDS_URL:
5858
return _FakeResponse(

0 commit comments

Comments
 (0)