Skip to content
Snippets Groups Projects
Commit 107aecad authored by nimrod's avatar nimrod
Browse files

Better testing of PerfData.

I wouldn't call it perfect or thorough, but it's a little better than
before.
parent e36d6620
No related branches found
No related tags found
No related merge requests found
Pipeline #1964 failed
......@@ -113,4 +113,13 @@ def test_output_parsing(output):
@pytest.mark.parametrize("line", PERF_DATA)
def test_data_perf(line):
"""Test parsing of perfdata."""
nagios.PerfData(line)
pd = nagios.PerfData(line)
assert isinstance(pd.name, str)
assert len(pd.name) > 0
assert isinstance(pd.value, float)
assert isinstance(pd.unit, str)
assert len(pd.unit) > 0
assert isinstance(pd.warning, (float, type(None)))
assert isinstance(pd.critical, (float, type(None)))
assert isinstance(pd.min, (float, type(None)))
assert isinstance(pd.max, (float, type(None)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment