-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.py
72 lines (47 loc) · 1.8 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
Non-exhaustive tests for the CUMTD API Python helper library. Currently only tests baseline positive cases and does not test for specific output.
"""
from cumtd import CumtdApi
from datetime import datetime
KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
mtd = CumtdApi(KEY, debug=True)
now = datetime.now()
print "Testing GetCalendarDatesByDate"
services = mtd.get_calendar_dates_by_date(now.strftime('%Y-%m-%d'))
print services
print "Testing GetCalendarDatesByService"
print mtd.get_calendar_dates_by_service(services['calendar_dates'][0]['service_id'])
print "Testing GetDeparturesByStop"
print mtd.get_departures_by_stop('GRNWRT')
print "Testing GetRoute"
print mtd.get_route('GREEN')
print "Testing GetRoutes"
print mtd.get_routes()
print "Testing GetShape"
print mtd.get_shape('5E')
print "Testing GetShapeBetweenStops"
print mtd.get_shape_between_stops('GRNNEIL:6', 'IU:1', '5E')
print "Testing GetStop"
print mtd.get_stop(['GRNNEIL', 'IU'])
print "Testing GetStops"
print mtd.get_stops()
print "Testing GetStopsByLatLon"
print mtd.get_stops_by_lat_lon('40.110999', '-88.245728')
print "Testing GetStopsBySearch"
print mtd.get_stops_by_search('state and william')
print "Testing GetStopTimesByTrip"
print mtd.get_stop_times_by_trip('1GN513__GN1')
print "Testing GetStopTimesByStop"
print mtd.get_stop_times_by_stop('GRNNEIL')
print "Testing GetPlannedTripsByLatLon"
print mtd.get_planned_trips_by_lat_lon('40.110999', '-88.245728', '40.107783', '-88.23163')
print "Testing GetPlannedTripsByStops"
print mtd.get_planned_trips_by_stops('GRNNEIL', 'IU')
print "Testing GetTrip"
print mtd.get_trip('1GN513__GN1')
print "Testing GetTripsByBlock"
print mtd.get_trips_by_block('GN1')
print "Testing GetTripsByRoute"
print mtd.get_trips_by_route('GREEN')
print "Testing GetLastFeedUpdate"
print mtd.get_last_feed_update()