Esempio n. 1
0
 def test_std_date_modality_string(self):
     input_value = '1989 troligen'
     expected = '1989 {{Probably}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 2
0
 def test_std_date_start_string(self):
     input_value = u'hösten 1983'
     expected = '{{other date|fall|1983}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 3
0
 def test_std_date_ending_string(self):
     input_value = '1700-talets mitt'
     expected = '{{other date|mid|{{other date|century|18}}}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 4
0
 def test_std_date_low_century_string(self):
     input_value = '700-talet'
     expected = '{{other date|century|8}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 5
0
 def test_std_date_century_range_string(self):
     input_value = '1700-1800-talet'
     expected = '{{other date|-' \
                '|{{other date|century|18}}' \
                '|{{other date|century|19}}}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 6
0
 def test_std_date_multiple_iso_string(self):
     input_value = '1989-02-04;1984'
     expected = '1989-02-04; 1984'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 7
0
 def test_std_date_decade_string(self):
     input_value = '1980-talet'
     expected = '{{other date|decade|1980}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 8
0
 def test_std_date_open_range_string_after(self):
     input_value = '1989-'
     expected = '{{other date|>|1989}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 9
0
 def test_std_date_open_range_string_before(self):
     input_value = '-1989'
     expected = '{{other date|<|1989}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 10
0
 def test_std_date_compact_range_string(self):
     input_value = '1989-90'
     expected = '{{other date|-|1989|1990}}'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 11
0
 def test_std_date_y_iso_string(self):
     input_value = '1989'
     expected = '1989'
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 12
0
 def test_std_date_bad_date_returns_none(self):
     input_value = 'bad date'
     expected = None
     self.assertEquals(Common.std_date(input_value), expected)
Esempio n. 13
0
 def test_std_date_nd_string_returns_empty_string(self):
     input_value = 'n.d'
     self.assertEquals(Common.std_date(input_value), '')
Esempio n. 14
0
 def test_std_date_on_empty_string_returns_empty_string(self):
     self.assertEquals(Common.std_date(''), '')