Skip to content

Commit

Permalink
Add more tests to cover num2words/base.py
Browse files Browse the repository at this point in the history
Signed-off-by: William José Moreno Reyes <williamjmorenor@gmail.com>
  • Loading branch information
williamjmorenor committed Oct 26, 2019
1 parent 95272ed commit ede3387
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@ def setUpClass(cls):
def test_to_currency_not_implemented(self):
with self.assertRaises(NotImplementedError):
self.base.to_currency(Decimal('1.00'), currency='EUR')

def test_error_to_cardinal_float(self):
from num2words.base import Num2Word_Base
with self.assertRaises(TypeError):
Num2Word_Base.to_cardinal_float(9)
with self.assertRaises(TypeError):
Num2Word_Base.to_cardinal_float("a")

def test_error_merge(self):
from num2words.base import Num2Word_Base
with self.assertRaises(NotImplementedError):
Num2Word_Base.merge(1,2,3)

0 comments on commit ede3387

Please sign in to comment.