* Remove some dead code.

* Overloadable _cents_terse

* One setup should be enough

* Move gen_high_numwords up

* Cards are optional.

* Line length

* DRY set_hight_numwords for EU base.

* Remove unused error message. It has to be an exception anyway.
This commit is contained in:
Mārtiņš Šulcs
2018-09-17 16:30:36 +03:00
committed by Ernesto Rodriguez Ortiz
parent 44354bf9ce
commit 2a99ff1061
20 changed files with 88 additions and 270 deletions

View File

@@ -30,6 +30,15 @@ class Num2WordsENTest(TestCase):
self.assertEqual(num2words(12.53), "twelve point five three")
self.assertEqual(num2words(12.59), "twelve point five nine")
def test_overflow(self):
with self.assertRaises(OverflowError):
num2words("1000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000")
def test_to_currency(self):
self.assertEqual(
num2words('38.4', lang='en', to='currency', seperator=' and',