@@ -16,37 +16,46 @@ def api_response(historical_fact_response):
1616class TestCoolFactGenerator :
1717
1818 def test_returns_response_with_json_when_called (self , birth_post_data ):
19- with apr .flask . test_client () as c :
19+ with apr .test_client () as c :
2020 res = c .post ('/' , json = birth_post_data )
2121
2222 assert res .json == {
23- 'contextOut' : [],
24- 'data' : {
23+ 'fulfillmentMessages' : [
24+ {
25+ 'platform' : 'ACTIONS_ON_GOOGLE' ,
26+ 'text' : {
27+ 'text' : [
28+ 'Today in the year 308, At '
29+ 'Carnuntum, Emperor emeritus '
30+ 'Diocletian confers with Galerius, '
31+ 'Augustus of the East, and '
32+ 'Maximianus, the recently returned '
33+ 'former Augustus of the West, in '
34+ 'an attempt to end the civil wars '
35+ 'of the Tetrarchy.'
36+ ]
37+ }
38+ }
39+ ],
40+ 'fulfillmentText' : 'Today in the year 308, At Carnuntum, Emperor '
41+ 'emeritus Diocletian confers with Galerius, '
42+ 'Augustus of the East, and Maximianus, the '
43+ 'recently returned former Augustus of the '
44+ 'West, in an attempt to end the civil wars of '
45+ 'the Tetrarchy.' ,
46+ 'outputContexts' : [],
47+ 'payload' : {
2548 'google' : {
2649 'expect_user_response' : True ,
2750 'is_ssml' : True ,
2851 'permissions_request' : None
29- },
52+ }
3053 },
31- 'displayText' : None ,
32- 'messages' : [{
33- 'speech' : 'Today in the year 308, At Carnuntum, Emperor '
34- 'emeritus Diocletian confers with Galerius, '
35- 'Augustus of the East, and Maximianus, the recently '
36- 'returned former Augustus of the West, in an '
37- 'attempt to end the civil wars of the Tetrarchy.' ,
38- 'type' : 0
39- }],
40- 'source' : 'webhook' ,
41- 'speech' : 'Today in the year 308, At Carnuntum, Emperor '
42- 'emeritus Diocletian confers with Galerius, Augustus '
43- 'of the East, and Maximianus, the recently returned '
44- 'former Augustus of the West, in an attempt to end '
45- 'the civil wars of the Tetrarchy.'
54+ 'source' : 'webhook'
4655 }
4756
4857 def test_returns_content_type_json_when_called (self , birth_post_data ):
49- with apr .flask . test_client () as c :
58+ with apr .test_client () as c :
5059 res = c .post ('/' , json = birth_post_data )
5160
5261 assert res .headers ['Content-Type' ] == 'application/json'
0 commit comments