def to_currency(self, val, longval=True, old=False): return Num2Word_Base.to_currency(self, val, currency='EUR', cents=True, seperator=' con', adjective=False)
def test_is_title(self): from num2words.base import Num2Word_Base self.base = Num2Word_Base() self.assertEqual(self.base.title("one"), "one") self.base.is_title = True self.assertEqual(self.base.title("one"), "One") self.base.exclude_title.append('one') self.assertEqual(self.base.title("one"), "one")
def test_error_merge(self): from num2words.base import Num2Word_Base self.base = Num2Word_Base() with self.assertRaises(NotImplementedError): self.base.merge(2, 3)
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 setUpClass(cls): super(Num2WordBaseTest, cls).setUpClass() cls.base = Num2Word_Base()