def METHOD_NAME(get_configuration, request):
    """Configure a custom rules and log alert level for testing.
    Restarting Wazuh is not needed for applying the configuration, it is optional.
    """
    # configuration for testing
    rules_dir = os.path.join(WAZUH_PATH, get_configuration['rule_dir'])
    if not os.path.exists(rules_dir):
        os.makedirs(rules_dir)
    file_test = os.path.join(test_data_path, get_configuration['rule_file'])
    file_dst = os.path.join(rules_dir, get_configuration['rule_file'])
    copy(file_test, file_dst)
    yield
    # restore previous configuration
    os.remove(file_dst)
    if len(os.listdir(rules_dir)) == 0:
        os.rmdir(rules_dir)