Exemplo n.º 1
0
def test_get_iso_timestamp():
    v = get_iso_timestamp()
    assert ISO_EXT_RE.match(v)
    ts = datetime.datetime.now()
    v = get_iso_timestamp(ts)
    assert parse_iso_datetime(v) == ts
Exemplo n.º 2
0
def test_get_iso_timestamp():
    v = get_iso_timestamp()
    assert ISO_EXT_RE.match(v)
    ts = datetime.datetime.now()
    v = get_iso_timestamp(ts)
    assert parse_iso_datetime(v) == ts
Exemplo n.º 3
0
def test_parse_iso_datetime():
    date = datetime.datetime.utcnow()
    date.replace(microsecond=0)
    assert date == parse_iso_datetime(date.isoformat() + "Z")
    with raises(ValueError):
        parse_iso_datetime("foobar")
Exemplo n.º 4
0
def test_parse_iso_datetime():
    date = datetime.datetime.utcnow()
    date.replace(microsecond=0)
    assert date == parse_iso_datetime(date.isoformat() + "Z")
    with raises(ValueError):
        parse_iso_datetime("foobar")