diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3c22927..48bf223 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -42,3 +42,5 @@ jobs: coverage run -m pytest coverage report + + diff --git a/hello.py b/hello.py deleted file mode 100644 index c36df38..0000000 --- a/hello.py +++ /dev/null @@ -1,12 +0,0 @@ -# hello.py -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 diff --git a/test_hello.py b/test_hello.py index 22ef81e..cf183e9 100644 --- a/test_hello.py +++ b/test_hello.py @@ -1,8 +1,18 @@ -# test_hello.py -from hello import app +import unittest -def test_hello(): - response = app.test_client().get('/') +def add(a, b): + return a + b - assert response.status_code == 200 - assert response.data == b'Hello, World!' \ No newline at end of file +class TestAddFunction(unittest.TestCase): + def test_add_positive_numbers(self): + self.assertEqual(add(1, 2), 3) + + def test_add_negative_numbers(self): + self.assertEqual(add(-1, -2), -3) + + def test_add_mixed_numbers(self): + self.assertEqual(add(1, -2), -1) + self.assertEqual(add(-1, 2), 1) + +if __name__ == '__main__': + unittest.main()