Esempio n. 1
0
def test_parse_timestamp_invalid():
	with pytest.raises(ValueError):
		parse_timestamp('zz')
Esempio n. 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)
Esempio n. 3
0
def test_parse_timestamp_timestamp():
	dt = datetime(2013, 8, 24, 3, 17, 56, 242421)
	timestamp = parse_timestamp(dt)
	assert timestamp == dt
Esempio n. 4
0
def test_parse_timestamp():
	timestamp = parse_timestamp('2013-08-24T23:17:56Z')
	assert timestamp == datetime(2013, 8, 24, 23, 17, 56)
Esempio n. 5
0
def test_parse_timestamp_invalid():
    with pytest.raises(ValueError):
        parse_timestamp('zz')
Esempio n. 6
0
def test_parse_timestamp_timestamp():
    dt = datetime(2013, 8, 24, 3, 17, 56, 242421)
    timestamp = parse_timestamp(dt)
    assert timestamp == dt
Esempio n. 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)
Esempio n. 8
0
def test_parse_timestamp():
    timestamp = parse_timestamp('2013-08-24T23:17:56Z')
    assert timestamp == datetime(2013, 8, 24, 23, 17, 56)