File: gen_mock.py

package info (click to toggle)
py-nextbusnext 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 148 kB
  • sloc: python: 752; makefile: 50
file content (23 lines) | stat: -rw-r--r-- 604 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from py_nextbus import NextBusClient
from tests.mock_responses import TEST_AGENCY_ID
from tests.mock_responses import TEST_ROUTE_ID
from tests.mock_responses import TEST_STOP_ID

client = NextBusClient()
agencies = client.agencies()
print("Agencies:")
print(agencies)

routes = client.routes(TEST_AGENCY_ID)
print("\nRoutes:")
print(routes)

route_details = client.route_details(TEST_ROUTE_ID, TEST_AGENCY_ID)
print("\nRoute Details:")
print(route_details)

predictions = client.predictions_for_stop(
    TEST_STOP_ID, TEST_ROUTE_ID, agency_id=TEST_AGENCY_ID
)
print("\nPredictions:")
print(predictions)