Пример #1
0
def test_format_date_negative_number():
    # Arrange
    dummy_format = "dummy format {}"

    # Act
    date = core.format_date("-1", dummy_format)

    # Assert
    assert date == 'DATE_ADD(CURRENT_TIMESTAMP(), -1, "day")'
Пример #2
0
def test_format_date_negative_number() -> None:
    # Arrange
    dummy_format = "dummy format {}"

    # Act
    date = core.format_date("-1", dummy_format)

    # Assert
    assert date == 'TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL -1 DAY)'
Пример #3
0
def test_format_date_yyy_mm_dd():
    # Act
    date = core.format_date("2018-05-15", core.START_TIMESTAMP)

    # Assert
    assert date == 'TIMESTAMP("2018-05-15 00:00:00")'