Example #1
0
def test_k8s_replicas(
    fix_register: FixRegister,
    section: StringTable,
    expected_check_result: Sequence[Union[Result, Metric]],
) -> None:
    check = fix_register.check_plugins[CheckPluginName("k8s_replicas")]
    assert list(check.check_function(section=parse_json(section))) == expected_check_result
Example #2
0
def test_k8s_replicas(info, expected):
    check = Check("k8s_replicas")
    parsed = parse_json(info)
    actual = check.run_check(None, {}, parsed)

    assertCheckResultsEqual(
        CheckResult(actual),
        CheckResult(expected),
    )
Example #3
0
def test_check_k8s_roles(fix_register, string_table, expected_result):
    check_plugin = fix_register.check_plugins[CheckPluginName("k8s_roles")]
    section = parse_json(string_table)
    assert list(check_plugin.check_function(
        params={}, section=section)) == expected_result
Example #4
0
def test_discover_k8s_roles(fix_register, string_table, expected_result):
    check_plugin = fix_register.check_plugins[CheckPluginName("k8s_roles")]
    section = parse_json(string_table)
    assert sorted(check_plugin.discovery_function(section)) == expected_result