Esempio n. 1
0
 def test_year_2000(self):
     result = replace_dates('January 5, 2000')
     assert result == 'January fifth, two thousand'
     result = replace_dates('September 28, 2004')
     assert result == 'September twenty eighth, two thousand four'
     result = replace_dates('March 7, 2016')
     assert result == 'March seventh, two thousand sixteen'
Esempio n. 2
0
 def test_it_does_not_consume_trailing_whitespace(self):
     result = replace_dates('November 9 ')
     assert result == 'November ninth '
Esempio n. 3
0
 def test_it_works(self):
     result = replace_dates('Jan. 10')
     assert result == 'January tenth'
Esempio n. 4
0
 def test_from_to(self):
     result = replace_dates('from 1500 to 1600')
     assert result == 'from fifteen hundred to sixteen hundred'
Esempio n. 5
0
 def test_in(self):
     result = replace_dates('in 1999')
     assert result == 'in nineteen ninety nine'
Esempio n. 6
0
 def test_it_works(self):
     result = replace_dates('Jan. 10, 1999')
     assert result == 'January tenth, nineteen ninety nine'
Esempio n. 7
0
 def test_year_1900(self):
     result = replace_dates('June 2, 1900')
     assert result == 'June second, nineteen hundred'
     result = replace_dates('December 31, 1999')
     assert result == 'December thirty first, nineteen ninety nine'
Esempio n. 8
0
 def test_year_1800(self):
     result = replace_dates('December 25, 1800')
     assert result == 'December twenty fifth, eighteen hundred'
     result = replace_dates('November 5, 1892')
     assert result == 'November fifth, eighteen ninety two'
Esempio n. 9
0
 def test_year_1700(self):
     result = replace_dates('January 10, 1700')
     assert result == 'January tenth, seventeen hundred'
     result = replace_dates('January 5, 1710')
     assert result == 'January fifth, seventeen ten'
Esempio n. 10
0
 def test_year_1600(self):
     assert replace_dates('February 10, 1600') == 'February tenth,' + \
         ' sixteen hundred'
     assert replace_dates('October 5, 1610') == 'October fifth, sixteen ten'
Esempio n. 11
0
 def test_replacing_two_dates(self):
     result = replace_dates('January 10, 2015 and January 11, 2015')
     assert result == 'January tenth, two thousand fifteen and January ' + \
         'eleventh, two thousand fifteen'