예제 #1
0
def test_check_functions_perfdata(string_table: StringTable,
                                  discovered: Sequence[Service],
                                  results) -> None:
    section = lnx_thermal.parse_lnx_thermal(string_table)
    for service, result in zip(discovered, results):
        assert isinstance(service.item, str)
        assert list(lnx_thermal.check_lnx_thermal(service.item, {},
                                                  section)) == result
예제 #2
0
def test_parse_and_discovery_function(string_table: StringTable,
                                      result: Sequence[Service]) -> None:
    section = lnx_thermal.parse_lnx_thermal(string_table)
    assert list(lnx_thermal.discover_lnx_thermal(section)) == result
예제 #3
0
def test_check_functions_perfdata_2(
        line: List[str], item: str, result: List[Union[Metric,
                                                       Result]]) -> None:
    section = lnx_thermal.parse_lnx_thermal([line])
    assert list(lnx_thermal.check_lnx_thermal(item, {}, section)) == result
예제 #4
0
def test_parse_and_discovery_function_2_no_item(line: List[str]) -> None:
    section = lnx_thermal.parse_lnx_thermal([line])
    assert list(lnx_thermal.discover_lnx_thermal(section)) == []
예제 #5
0
def test_parse_and_discovery_function_2(line: List[str], item: str):
    section = lnx_thermal.parse_lnx_thermal([line])
    assert list(
        lnx_thermal.discover_lnx_thermal(section)) == [Service(item=item)]