-
-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathtest_app.py
More file actions
27 lines (18 loc) · 600 Bytes
/
test_app.py
File metadata and controls
27 lines (18 loc) · 600 Bytes
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
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from web import myapp
import unittest
# python -m unittest test_app
class TestMyApp(unittest.TestCase):
def setUp(self):
self.app = myapp.test_client()
def test_main(self):
rv = self.app.get('/')
assert rv.status == '200 OK'
assert b'Congratulations' in rv.data
#assert False
def test_404(self):
rv = self.app.get('/other')
self.assertEqual(rv.status, '404 NOT FOUND')
if __name__ == '__main__':
unittest.main()