Skip to content

Commit

Permalink
ccccccccccc
Browse files Browse the repository at this point in the history
  • Loading branch information
zelalemshiferaw committed May 11, 2024
1 parent 1af6fb1 commit e6ba4dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ jobs:
coverage run -m pytest
coverage report
12 changes: 0 additions & 12 deletions hello.py

This file was deleted.

22 changes: 16 additions & 6 deletions test_hello.py
Original file line number Diff line number Diff line change
@@ -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!'
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()

0 comments on commit e6ba4dd

Please sign in to comment.