def test_getDate_none(self): # Arrange value = None # Act output = utils.getDate(value) # Assert self.assertIsInstance(output, datetime.date)
def test_getDate_datetime_string_yymmdd(self): # Arrange value = "191019" # Act output = utils.getDate(value) # Assert self.assertIsInstance(output, datetime.date) self.assertEqual(output, datetime.date(2019, 10, 19))
def test_getDate_datetime_timestamp(self): # Arrange value = 1571515306 # Act output = utils.getDate(value) # Assert self.assertIsInstance(output, datetime.date) self.assertEqual(output, datetime.date(2019, 10, 19))
def test_getDate_datetime_datetime(self): # Arrange value = datetime.datetime(2019, 10, 19, 12, 00, 00) # Act output = utils.getDate(value) # Assert self.assertIsInstance(output, datetime.date) self.assertEqual(output, value)