示例#1
0
def test_parse_timestamp_invalid():
	with pytest.raises(ValueError):
		parse_timestamp('zz')
示例#2
0
def test_parse_timestamp_fractional():
	timestamp = parse_timestamp('2013-08-24T03:17:56.242421Z')
	assert timestamp == datetime(2013, 8, 24, 3, 17, 56, 242421)
示例#3
0
def test_parse_timestamp_timestamp():
	dt = datetime(2013, 8, 24, 3, 17, 56, 242421)
	timestamp = parse_timestamp(dt)
	assert timestamp == dt
示例#4
0
def test_parse_timestamp():
	timestamp = parse_timestamp('2013-08-24T23:17:56Z')
	assert timestamp == datetime(2013, 8, 24, 23, 17, 56)
示例#5
0
def test_parse_timestamp_invalid():
    with pytest.raises(ValueError):
        parse_timestamp('zz')
示例#6
0
def test_parse_timestamp_timestamp():
    dt = datetime(2013, 8, 24, 3, 17, 56, 242421)
    timestamp = parse_timestamp(dt)
    assert timestamp == dt
示例#7
0
def test_parse_timestamp_fractional():
    timestamp = parse_timestamp('2013-08-24T03:17:56.242421Z')
    assert timestamp == datetime(2013, 8, 24, 3, 17, 56, 242421)
示例#8
0
def test_parse_timestamp():
    timestamp = parse_timestamp('2013-08-24T23:17:56Z')
    assert timestamp == datetime(2013, 8, 24, 23, 17, 56)