Skip to content

Commit

Permalink
Add test to improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlon Rodriguez Garcia committed Nov 19, 2024
1 parent 8c712e9 commit 11c452e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,34 @@ def test_is_title(self):
self.base.title("one"),
"one"
)

def test_set_high_numwords_not_implemented(self):
with self.assertRaises(NotImplementedError):
self.base.set_high_numwords()

def test_splitnum_with_remainder(self):
from num2words.base import Num2Word_Base
self.base = Num2Word_Base()
value = 12345
expected_output = [
[(self.base.cards[1], 1)],
[(self.base.cards[2], 2)],
[(self.base.cards[3], 3)],
[(self.base.cards[4], 4)],
[(self.base.cards[5], 5)]
]
self.assertEqual(self.base.splitnum(value),
expected_output)

# Additional test case for the specific conditional
value = 12345.67
expected_output = [
[(self.base.cards[1], 1)],
[(self.base.cards[2], 2)],
[(self.base.cards[3], 3)],
[(self.base.cards[4], 4)],
[(self.base.cards[5], 5)],
[(self.base.cards[67], 67)]
]
self.assertEqual(self.base.splitnum(value),
expected_output)

0 comments on commit 11c452e

Please sign in to comment.