コード例 #1
0
def test_compliance(
    _file, network_os, get_json_data, get_text_data, get_python_data
):  # pylint: disable=redefined-outer-name
    truncate_file = os.path.join(MOCK_DIR, _file[: -len(INTEND_FILE)])

    intended_cfg = get_text_data(os.path.join(MOCK_DIR, _file))
    backup_cfg = get_text_data(truncate_file + "_backup.txt")
    received_data = get_json_data(truncate_file + "_received.json")
    features = get_python_data(truncate_file + "_feature.py", "features")
    assert compliance.compliance(features, backup_cfg, intended_cfg, network_os, "string") == received_data
コード例 #2
0
def test_incorrect_cfg_type():
    with pytest.raises(ValueError):
        compliance.compliance({}, "backup_cfg", "intended_cfg", "cisco_ios", "text")