From 83a400bebaff8fa2e177fa10baf0c1c17b30c231 Mon Sep 17 00:00:00 2001 From: kudlaty Date: Thu, 22 Mar 2018 18:38:31 +0100 Subject: [PATCH] feature/kjug added build stephb --- sources/test_webapp.py | 15 +++++++++++++++ sources/webapp.py | 10 ++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sources/test_webapp.py create mode 100644 sources/webapp.py diff --git a/sources/test_webapp.py b/sources/test_webapp.py new file mode 100644 index 0000000..41b67b4 --- /dev/null +++ b/sources/test_webapp.py @@ -0,0 +1,15 @@ +from webapp import app +import unittest + + +class BasicTestCase(unittest.TestCase): + + def test_index(self): + tester = app.test_client(self) + response = tester.get('/', content_type='html/text') + self.assertEqual(response.status_code, 200) + self.assertEqual(response.data, b'Hello, World!') + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/webapp.py b/sources/webapp.py new file mode 100644 index 0000000..c91e8eb --- /dev/null +++ b/sources/webapp.py @@ -0,0 +1,10 @@ +from flask import Flask +app = Flask(__name__) + +@app.route('/') +def hello(): + return "Hello, World!" + + +if __name__ == '__main__': + app.run() \ No newline at end of file