Loading mnpw/nagios.py +3 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,12 @@ def parse_perf_data(line): # noqa: MC0001 for i in range(len(value) - 1, 0, -1): if value[i].isdigit(): break value, unit = ( pd["value"], pd["unit"] = ( float(value[: i + 1]), value[i + 1 :], # noqa: E203 ) pd["value"] = value pd["unit"] = unit else: pd["value"] = float(value) # Get the remaining fields, if available. try: Loading tests/test_nagios.py +1 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,7 @@ def test_data_perf(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.unit, (str, type(None))) assert isinstance(pd.warning, (float, type(None))) assert isinstance(pd.critical, (float, type(None))) assert isinstance(pd.min, (float, type(None))) Loading Loading
mnpw/nagios.py +3 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,12 @@ def parse_perf_data(line): # noqa: MC0001 for i in range(len(value) - 1, 0, -1): if value[i].isdigit(): break value, unit = ( pd["value"], pd["unit"] = ( float(value[: i + 1]), value[i + 1 :], # noqa: E203 ) pd["value"] = value pd["unit"] = unit else: pd["value"] = float(value) # Get the remaining fields, if available. try: Loading
tests/test_nagios.py +1 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,7 @@ def test_data_perf(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.unit, (str, type(None))) assert isinstance(pd.warning, (float, type(None))) assert isinstance(pd.critical, (float, type(None))) assert isinstance(pd.min, (float, type(None))) Loading