Ejemplo n.º 1
0
def test_datetime_date():
    expected = datetime.date(1987, 6, 5)
    dt = dateutils.datetime(1987, 6, 5, 4, 3, 2, 1, None)
    assert expected == dt.date()
Ejemplo n.º 2
0
def test_datetime_creation_before_1900():
    expected = datetime.datetime(1765, 1, 3, 10, 2, 13)
    result = dateutils.datetime(1765, 1, 3, 10, 2, 13)
    assert expected == result
Ejemplo n.º 3
0
def test_datetime_strftime_before_1900():
    new_datetime = dateutils.datetime(1765, 1, 3, 10, 2, 13)
    expected = "Thu, 03 Jan 1765 10:02:13 +0000"
    result = new_datetime.strftime("%a, %d %b %Y %H:%M:%S +0000")
    assert expected == result
Ejemplo n.º 4
0
def test_datetime_creation_after_1900():
    expected = datetime.datetime(1908, 3, 12, 12, 12, 12)
    result = dateutils.datetime(1908, 3, 12, 12, 12, 12)
    assert expected == result
Ejemplo n.º 5
0
def test_datetime_date():
    expected = datetime.date(1987, 6, 5)
    dt = dateutils.datetime(1987, 6, 5, 4, 3, 2, 1, None)
    assert expected == dt.date()
Ejemplo n.º 6
0
def test_datetime_strftime_before_1900():
    new_datetime = dateutils.datetime(1765, 1, 3, 10, 2, 13)
    expected = "Thu, 03 Jan 1765 10:02:13 +0000"
    result = new_datetime.strftime("%a, %d %b %Y %H:%M:%S +0000")
    assert expected == result
Ejemplo n.º 7
0
def test_datetime_creation_before_1900():
    expected = datetime.datetime(1765, 1, 3, 10, 2, 13)
    result = dateutils.datetime(1765, 1, 3, 10, 2, 13)
    assert expected == result
Ejemplo n.º 8
0
def test_datetime_creation_after_1900():
    expected = datetime.datetime(1908, 3, 12, 12, 12, 12)
    result = dateutils.datetime(1908, 3, 12, 12, 12, 12)
    assert expected == result