Add tip calculator project structure and documentation

This commit is contained in:
2026-10-03 12:27:36 +08:00
commit 78be05027f
9 changed files with 170 additions and 0 deletions
View File
+19
View File
@@ -0,0 +1,19 @@
import unittest
from tip_calculator.calculator import bill_per_person
class BillPerPersonTests(unittest.TestCase):
def test_course_example(self):
self.assertEqual(bill_per_person(124.56, 12, 7), 19.93)
def test_tip_split_five_ways(self):
self.assertEqual(bill_per_person(150, 12, 5), 33.6)
def test_zero_people_raises(self):
with self.assertRaises(ValueError):
bill_per_person(100, 10, 0)
if __name__ == "__main__":
unittest.main()