예제 #1
0
 def to_currency(self, val, longval=True, old=False):
     return Num2Word_Base.to_currency(self,
                                      val,
                                      currency='EUR',
                                      cents=True,
                                      seperator=' con',
                                      adjective=False)
예제 #2
0
 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")
예제 #3
0
 def test_error_merge(self):
     from num2words.base import Num2Word_Base
     self.base = Num2Word_Base()
     with self.assertRaises(NotImplementedError):
         self.base.merge(2, 3)
예제 #4
0
 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")
예제 #5
0
 def setUpClass(cls):
     super(Num2WordBaseTest, cls).setUpClass()
     cls.base = Num2Word_Base()