Example #1
0
 def test_input(self):
     assert number_to_words(89) == u'eighty-nine'
     assert number_to_words(89, "es") == u'ochenta y nueve'
     assert number_to_words(89, "es",
                            num_type="ordinal") == u'ochenta y nueve'
     pytest.raises(ValueError,
                   number_to_words,
                   -89,
                   "es",
                   num_type="ordinal")
 def test_input(self):
     assert number_to_words(89) == u'eighty-nine'
     assert number_to_words(89, "es") == u'ochenta y nueve'
     assert number_to_words(89, "es", num_type="ordinal") == u'ochenta y nueve'
     pytest.raises(ValueError, number_to_words, -89, "es", num_type="ordinal")
Example #3
0
    def test_empty_input_invalid_locale_or_num_type(self):
        pytest.raises(ValueError, number_to_words, 2, "aaa")

        assert number_to_words(2, "en", "aaaa") == u"two"
    def test_empty_input_invalid_locale_or_num_type(self):
        pytest.raises(ValueError, number_to_words, 2, "aaa")

        assert number_to_words(2, "en", "aaaa") == u"two"