-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
31 lines (23 loc) · 846 Bytes
/
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
from lessenger.Controller import LessengerController
from lessenger.Parser import LessengerParser
from lessenger.GoogleGeo import GoogleGeoService
from lessenger.DarkSky import DarkSkyService
import forecastio
import pprint
DARK_SKY = "8b4d5ca925446f9db4f7d7d0aac8b40c"
GMAPS_KEY = "AIzaSyD7W7v5psM8TDJwUV2WxsPkoYRtByh07Y0"
pp = pprint.PrettyPrinter(indent=4)
geo_service = GoogleGeoService(GMAPS_KEY)
weather_service = DarkSkyService(DARK_SKY)
request_parser = LessengerParser()
lessenger_control = LessengerController(geo_service, weather_service, request_parser)
test_inputs = [
"What's the weather tomorrow in Fresno",
"weather tomorrow in 93722",
"Fresno"
]
for query in test_inputs:
geocode_result = lessenger_control.get_response(query)
if geocode_result:
pp.pprint(geocode_result)
print("\n")