|
|
|
@ -34,11 +34,8 @@ def test_date():
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
q = date_chart.render_pyquery() |
|
|
|
|
|
|
|
|
|
assert list(map(lambda t: t.split(' ')[0], |
|
|
|
|
q(".axis.x text").map(texts))) == [ |
|
|
|
|
'2013-01-12', '2013-01-24', '2013-02-04', '2013-02-16' |
|
|
|
|
] |
|
|
|
|
dates = list(map(lambda t: t.split(' ')[0], q(".axis.x text").map(texts))) |
|
|
|
|
assert dates == ['2013-01-12', '2013-01-24', '2013-02-04', '2013-02-16'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_time(): |
|
|
|
@ -50,11 +47,10 @@ def test_time():
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
q = time_chart.render_pyquery() |
|
|
|
|
|
|
|
|
|
assert list(map(lambda t: t.split(' ')[0], |
|
|
|
|
q(".axis.x text").map(texts))) == [ |
|
|
|
|
'02:46:40', '05:33:20', '08:20:00', '11:06:40', |
|
|
|
|
'13:53:20', '16:40:00', '19:26:40' |
|
|
|
|
dates = list(map(lambda t: t.split(' ')[0], q(".axis.x text").map(texts))) |
|
|
|
|
assert dates == [ |
|
|
|
|
'02:46:40', '05:33:20', '08:20:00', '11:06:40', '13:53:20', '16:40:00', |
|
|
|
|
'19:26:40' |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -69,11 +65,10 @@ def test_datetime():
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
q = datetime_chart.render_pyquery() |
|
|
|
|
|
|
|
|
|
assert list(map(lambda t: t.split(' ')[0], |
|
|
|
|
q(".axis.x text").map(texts))) == [ |
|
|
|
|
'2013-01-12T14:13:20', '2013-01-24T04:00:00', |
|
|
|
|
'2013-02-04T17:46:40', '2013-02-16T07:33:20' |
|
|
|
|
dates = list(map(lambda t: t.split(' ')[0], q(".axis.x text").map(texts))) |
|
|
|
|
assert dates == [ |
|
|
|
|
'2013-01-12T14:13:20', '2013-01-24T04:00:00', '2013-02-04T17:46:40', |
|
|
|
|
'2013-02-16T07:33:20' |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -107,10 +102,10 @@ def test_date_xrange():
|
|
|
|
|
datey.xrange = (date(2013, 1, 1), date(2013, 3, 1)) |
|
|
|
|
|
|
|
|
|
q = datey.render_pyquery() |
|
|
|
|
assert list(map(lambda t: t.split(' ')[0], |
|
|
|
|
q(".axis.x text").map(texts))) == [ |
|
|
|
|
'2013-01-01', '2013-01-12', '2013-01-24', '2013-02-04', |
|
|
|
|
'2013-02-16', '2013-02-27' |
|
|
|
|
dates = list(map(lambda t: t.split(' ')[0], q(".axis.x text").map(texts))) |
|
|
|
|
assert dates == [ |
|
|
|
|
'2013-01-01', '2013-01-12', '2013-01-24', '2013-02-04', '2013-02-16', |
|
|
|
|
'2013-02-27' |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -125,10 +120,8 @@ def test_date_labels():
|
|
|
|
|
datey.x_labels = [date(2013, 1, 1), date(2013, 2, 1), date(2013, 3, 1)] |
|
|
|
|
|
|
|
|
|
q = datey.render_pyquery() |
|
|
|
|
assert list(map(lambda t: t.split(' ')[0], |
|
|
|
|
q(".axis.x text").map(texts))) == [ |
|
|
|
|
'2013-01-01', '2013-02-01', '2013-03-01' |
|
|
|
|
] |
|
|
|
|
dates = list(map(lambda t: t.split(' ')[0], q(".axis.x text").map(texts))) |
|
|
|
|
assert dates == ['2013-01-01', '2013-02-01', '2013-03-01'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_utc_timestamping(): |
|
|
|
|