Exemplo n.º 1
0
 def test_get_valid_iso_date_9(self):
     """ non-valid dates return empty string """
     self.assertTrue(get_valid_iso_date('abc') == '')
Exemplo n.º 2
0
 def test_get_valid_iso_date_7(self):
     """ test MM/DD/YYYY format """
     self.assertTrue(get_valid_iso_date('2/7/2019') == '2019-02-07')
Exemplo n.º 3
0
 def test_get_valid_iso_date_8(self):
     """ blank out 0 date """
     self.assertTrue(get_valid_iso_date('0 - 0') == '')
Exemplo n.º 4
0
 def test_get_valid_iso_date_6(self):
     """ test range of years, like YYYY - YYYY """
     self.assertTrue(get_valid_iso_date('2019 - 2019') == '2019-01-01')
Exemplo n.º 5
0
 def test_get_valid_iso_date_5(self):
     """ test YYYYMM date """
     self.assertTrue(get_valid_iso_date('201902') == '2019-02-01')
Exemplo n.º 6
0
 def test_get_valid_iso_date_4(self):
     """ test YYYYMMDD date """
     self.assertTrue(get_valid_iso_date('20190207') == '2019-02-07')
Exemplo n.º 7
0
 def test_get_valid_iso_date_3(self):
     """ test YYYY date """
     self.assertTrue(get_valid_iso_date('2019') == '2019-01-01')
Exemplo n.º 8
0
 def test_get_valid_iso_date_1(self):
     """ test iso YYYY-MM-DD date """
     self.assertTrue(get_valid_iso_date('2019-02-07') == '2019-02-07')