Added Files

This commit is contained in:
Joachim Hummel
2020-07-22 14:13:09 +02:00
parent 200cc84109
commit ff1789b3e3
12 changed files with 156 additions and 0 deletions

27
test_app.py Normal file
View File

@@ -0,0 +1,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()