Add test case
This commit is contained in:
parent
d3a439bb49
commit
3d60e648e4
|
@ -0,0 +1,11 @@
|
||||||
|
{"description": {"fstype": "tmpfs", "hostname": "ehoiai.int.wsr.at", "measure": "time_until_disk_full", "mountpoint": "/run/user/1054", "node": "rorschach.hjp.at", "remote_addr": "", "unit": "s"},
|
||||||
|
"data": [
|
||||||
|
[1674806402.1014915, 1000000000.0],
|
||||||
|
[1674814201.3452954, 1000000000.0],
|
||||||
|
[1675164602.4004557, 1000000000.0],
|
||||||
|
[1675165201.6291275, 1000000000.0],
|
||||||
|
[1675165802.2402072, 1000000000.0],
|
||||||
|
[1675166401.542857, 1000000000.0],
|
||||||
|
[1675167002.2809808, 1000000000.0],
|
||||||
|
[1675167601.2632012, 1000000000.0],
|
||||||
|
[1675168201.8321788, 1000000000.0]]}
|
|
@ -0,0 +1,3 @@
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
pythonpath = "."
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,28 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from dashboard import TimeSeries
|
||||||
|
|
||||||
|
def test_timeseries_1():
|
||||||
|
data = {"description": {"fstype": "tmpfs", "hostname": "ehoiai.int.wsr.at", "measure": "time_until_disk_full", "mountpoint": "/run/user/1054", "node": "rorschach.hjp.at", "remote_addr": "", "unit": "s"},
|
||||||
|
"data": [
|
||||||
|
[1674806402.1014915, 1000000000.0],
|
||||||
|
[1674814201.3452954, 1000000000.0],
|
||||||
|
[1675164602.4004557, 1000000000.0],
|
||||||
|
[1675165201.6291275, 1000000000.0],
|
||||||
|
[1675165802.2402072, 1000000000.0],
|
||||||
|
[1675166401.542857, 1000000000.0],
|
||||||
|
[1675167002.2809808, 1000000000.0],
|
||||||
|
[1675167601.2632012, 1000000000.0],
|
||||||
|
[1675168201.8321788, 1000000000.0]]}
|
||||||
|
config = {
|
||||||
|
"type": "timeseries",
|
||||||
|
"multi": True,
|
||||||
|
"stops": [ 2592000, 604800, 86400 ],
|
||||||
|
"data": [
|
||||||
|
"605da6f41f58b122f41283823a99faa36286961a106ac901bb2b2d730fddc778"
|
||||||
|
],
|
||||||
|
"yscale": "log",
|
||||||
|
}
|
||||||
|
ts = TimeSeries(config)
|
||||||
|
graph = ts.graph
|
||||||
|
assert graph
|
Loading…
Reference in New Issue