Esempio n. 1
0
def test_check_printer_input_capacity_not_reported_if_unit_is_unkown_if_capacity_max_unkown(
        capacity_unit, capacity_max):
    string_table = [[["1.42", "", "", "0", capacity_unit, capacity_max, "11"]]]
    params = {"capacity_levels": (80, 20)}
    item = "42"
    data = parse_printer_io(string_table)
    result = check_printer_input(item, params, data)
    expected_result = [
        Result(state=State.OK, summary="Status: Available and idle"),
        Result(state=State.OK, summary="Alerts: None"),
    ]
    assert list(result) == expected_result
Esempio n. 2
0
def test_check_printer_input_capacity_not_reported_if_unit_is_unkown(
    capacity_unit, ):
    string_table = [[["1.42", "", "", "0", capacity_unit, "42", "11"]]]
    params = {"capacity_levels": (80, 20)}
    item = "42"
    data = parse_printer_io(string_table)
    result = check_printer_input(item, params, data)
    expected_result = [
        Result(state=State.OK, summary="Status: Available and idle"),
        Result(state=State.OK, summary="Alerts: None"),
        Result(state=State.WARN,
               summary="Remaining: 26.19% (warn/crit below 80.00%/20.00%)"),
    ]
    assert list(result) == expected_result
Esempio n. 3
0
def test_inventory_printer_io(info, expected_result):
    data = parse_printer_io(info)
    result = discovery_printer_io(data)
    assert list(result) == expected_result
Esempio n. 4
0
def test_check_priner_output(item, params, info, expected_result):
    data = parse_printer_io(info)
    result = check_printer_output(item, params, data)
    assert list(result) == expected_result