Skip to content

Commit

Permalink
Update test_sum_of_digits.py
Browse files Browse the repository at this point in the history
adding "with" in the test names provides a bit more context about what inputs are being tested against, making the test scenarios clearer and more descriptive for people to read it
  • Loading branch information
SEMIRATESFAI authored Jan 12, 2025
1 parent 1455cd1 commit 76ba362
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solutions/tests/challenge_9/test_sum_of_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
class TestSumOfDigits(unittest.TestCase):
"""Tests for the sum_of_digits function."""

def test_positive_integer(self):
def test_with_positive_integer(self):
"""Ensure that the sum of digits of a positive integer is calculated correctly."""
self.assertEqual(sum_of_digits(123), 6)

def test_large_integer(self):
def test_with_large_integer(self):
"""Ensure that the sum of digits of a large positive integer is calculated correctly."""
self.assertEqual(sum_of_digits(4567), 22)

def test_zero(self):
def test_with_zero(self):
"""Ensure that the sum of digits of zero is zero."""
self.assertEqual(sum_of_digits(0), 0)

Expand Down

0 comments on commit 76ba362

Please sign in to comment.