File tree Expand file tree Collapse file tree 3 files changed +62
-1
lines changed
appengine/standard/migration/urlfetch Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
1
14
15
+ import main
16
+ import os
17
+
18
+
19
+ def test_index ():
20
+ main .app .testing = True
21
+ client = main .app .test_client ()
22
+
23
+ r = client .get ('/' )
24
+ assert r .status_code == 200
25
+ assert 'Google is built by a large team ' in r .data .decode ('utf-8' )
26
+
27
+ r = client .get ('/callback' )
28
+ assert r .status_code == 200
29
+ assert 'Response number 1 is ' in r .data .decode ('utf-8' )
30
+ assert 'Response number 2 is ' in r .data .decode ('utf-8' )
31
+ assert 'Response number 3 is ' in r .data .decode ('utf-8' )
32
+ assert 'Response number 4 is ' in r .data .decode ('utf-8' )
Original file line number Diff line number Diff line change @@ -41,4 +41,9 @@ def server_error(e):
41
41
An internal error occurred: <pre>{}</pre>
42
42
See logs for full stacktrace.
43
43
""" .format (e ), 500
44
- # [END app]
44
+ # [END app]
45
+
46
+
47
+ if __name__ == '__main__' :
48
+ # This is used when running locally.
49
+ app .run (host = '127.0.0.1' , port = 8080 , debug = True )
Original file line number Diff line number Diff line change
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import main
16
+ import os
17
+
18
+
19
+ def test_index ():
20
+ main .app .testing = True
21
+ client = main .app .test_client ()
22
+
23
+ r = client .get ('/' )
24
+ assert r .status_code == 200
25
+ assert 'Google is built by a large team ' in r .data .decode ('utf-8' )
You can’t perform that action at this time.
0 commit comments