예제 #1
0
    def test_getDate_none(self):
        # Arrange
        value = None

        # Act
        output = utils.getDate(value)

        # Assert
        self.assertIsInstance(output, datetime.date)
예제 #2
0
    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))
예제 #3
0
    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))
예제 #4
0
    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)