martinzink commented on code in PR #2144:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2144#discussion_r2997365144
##########
behave_framework/src/minifi_test_framework/steps/configuration_steps.py:
##########
@@ -21,30 +21,30 @@
@step('MiNiFi configuration "{config_key}" is set to "{config_value}"')
-def step_impl(context: MinifiTestContext, config_key: str, config_value: str):
+def set_minifi_config_property(context: MinifiTestContext, config_key: str,
config_value: str):
context.get_or_create_default_minifi_container().set_property(config_key,
config_value)
@step("log metrics publisher is enabled in MiNiFi")
-def step_impl(context: MinifiTestContext):
+def enable_minifi_log_metrics_publisher(context: MinifiTestContext):
context.get_or_create_default_minifi_container().enable_log_metrics_publisher()
@step('log property "{log_property_key}" is set to "{log_property_value}"')
-def step_impl(context: MinifiTestContext, log_property_key: str,
log_property_value: str):
+def set_minifi_log_property(context: MinifiTestContext, log_property_key: str,
log_property_value: str):
context.get_or_create_default_minifi_container().set_log_property(log_property_key,
log_property_value)
@given("OpenSSL FIPS mode is enabled in MiNiFi")
-def step_impl(context: MinifiTestContext):
+def enable_minifi_openssl_fips_mode(context: MinifiTestContext):
context.get_or_create_default_minifi_container().enable_openssl_fips_mode()
@given("flow configuration path is set up in flow url property")
-def step_impl(context: MinifiTestContext):
+def setup_flow_config_path_in_url(context: MinifiTestContext):
Review Comment:
totally agree [review
changes](https://github.com/apache/nifi-minifi-cpp/pull/2144/commits/8db1c0e92203b25665e407adc5fb7033666a31d6)
##########
behave_framework/src/minifi_test_framework/steps/core_steps.py:
##########
@@ -72,127 +72,127 @@ def __add_directory_with_file_to_container(context:
MinifiTestContext, directory
@step('a directory at "{directory}" has a file with the content "{content}" in
the "{flow_name}" flow')
@step("a directory at '{directory}' has a file with the content '{content}' in
the '{flow_name}' flow")
-def step_impl(context: MinifiTestContext, directory: str, content: str,
flow_name: str):
+def create_file_with_content_in_directory_for_flow(context: MinifiTestContext,
directory: str, content: str, flow_name: str):
__add_directory_with_file_to_container(context, directory,
str(uuid.uuid4()), content, flow_name)
@step('a directory at "{directory}" has a file with the content "{content}"')
@step("a directory at '{directory}' has a file with the content '{content}'")
-def step_impl(context: MinifiTestContext, directory: str, content: str):
+def create_file_with_content_in_directory(context: MinifiTestContext,
directory: str, content: str):
context.execute_steps(f'given a directory at "{directory}" has a file with
the content "{content}" in the "{DEFAULT_MINIFI_CONTAINER_NAME}" flow')
@step('a directory at "{directory}" has a file "{file_name}" with the content
"{content}"')
-def step_impl(context: MinifiTestContext, directory: str, file_name: str,
content: str):
+def create_file_with_name_and_content_in_directory(context: MinifiTestContext,
directory: str, file_name: str, content: str):
__add_directory_with_file_to_container(context, directory, file_name,
content, DEFAULT_MINIFI_CONTAINER_NAME)
@step('a file with filename "{file_name}" and content "{content}" is present
in "{path}"')
-def step_impl(context: MinifiTestContext, file_name: str, content: str, path:
str):
+def file_with_name_and_content_present_in_path(context: MinifiTestContext,
file_name: str, content: str, path: str):
new_content = content.replace("\\n", "\n")
context.get_or_create_default_minifi_container().files.append(File(os.path.join(path,
file_name), new_content))
@given('a file with the content "{content}" is present in "{path}" in the
"{container_name}" flow')
-def step_impl(context: MinifiTestContext, content: str, path: str,
container_name: str):
+def file_with_content_present_in_path_for_flow(context: MinifiTestContext,
content: str, path: str, container_name: str):
new_content = content.replace("\\n", "\n")
context.get_or_create_minifi_container(container_name).files.append(File(os.path.join(path,
str(uuid.uuid4())), new_content))
@given('a file with the content "{content}" is present in "{path}"')
@given("a file with the content '{content}' is present in '{path}'")
-def step_impl(context: MinifiTestContext, content: str, path: str):
+def file_with_content_present_in_path(context: MinifiTestContext, content:
str, path: str):
context.execute_steps(f"given a file with the content \"{content}\" is
present in \"{path}\" in the \"{DEFAULT_MINIFI_CONTAINER_NAME}\" flow")
@when('a file with the content "{content}" is placed in "{path}" in the
"{container_name}" flow')
-def step_impl(context: MinifiTestContext, content: str, path: str,
container_name: str):
+def place_file_with_content_in_path_for_flow(context: MinifiTestContext,
content: str, path: str, container_name: str):
new_content = content.replace("\\n", "\n")
context.containers[container_name].add_file_to_running_container(new_content,
path)
@when('a file with the content "{content}" is placed in "{path}"')
-def step_impl(context: MinifiTestContext, content: str, path: str):
+def place_file_with_content_in_path(context: MinifiTestContext, content: str,
path: str):
context.execute_steps(f"when a file with the content \"{content}\" is
placed in \"{path}\" in the \"{DEFAULT_MINIFI_CONTAINER_NAME}\" flow")
@given("an empty file is present in \"{path}\"")
-def step_impl(context, path):
+def empty_file_present_in_path(context, path):
context.get_or_create_default_minifi_container().files.append(File(os.path.join(path,
str(uuid.uuid4())), ""))
@given('a host resource file "{filename}" is bound to the "{container_path}"
path in the MiNiFi container "{container_name}"')
-def step_impl(context: MinifiTestContext, filename: str, container_path: str,
container_name: str):
+def bind_host_resource_file_to_container_path_for_container(context:
MinifiTestContext, filename: str, container_path: str, container_name: str):
path = os.path.join(context.resource_dir, filename)
context.get_or_create_minifi_container(container_name).add_host_file(path,
container_path)
@given('a host resource file "{filename}" is bound to the "{container_path}"
path in the MiNiFi container')
-def step_impl(context: MinifiTestContext, filename: str, container_path: str):
+def bind_host_resource_file_to_container_path(context: MinifiTestContext,
filename: str, container_path: str):
context.execute_steps(f"given a host resource file \"{filename}\" is bound
to the \"{container_path}\" path in the MiNiFi container
\"{DEFAULT_MINIFI_CONTAINER_NAME}\"")
@step("after {duration} have passed")
@step("after {duration} has passed")
-def step_impl(context: MinifiTestContext, duration: str):
+def wait_duration(context: MinifiTestContext, duration: str):
time.sleep(humanfriendly.parse_timespan(duration))
@when("MiNiFi is stopped")
-def step_impl(context: MinifiTestContext):
+def stop_minifi(context: MinifiTestContext):
context.get_or_create_default_minifi_container().stop()
@when("the \"{container_name}\" flow is stopped")
-def step_impl(context: MinifiTestContext, container_name: str):
+def stop_flow(context: MinifiTestContext, container_name: str):
context.get_or_create_minifi_container(container_name).stop()
@when("MiNiFi is restarted")
-def step_impl(context: MinifiTestContext):
+def restart_minifi(context: MinifiTestContext):
context.get_or_create_default_minifi_container().restart()
@when("the \"{container_name}\" flow is restarted")
-def step_impl(context: MinifiTestContext, container_name: str):
+def restart_flow(context: MinifiTestContext, container_name: str):
context.get_or_create_minifi_container(container_name).restart()
@when("the \"{container_name}\" flow is started")
-def step_impl(context: MinifiTestContext, container_name: str):
+def start_flow(context: MinifiTestContext, container_name: str):
context.get_or_create_minifi_container(container_name).start()
@when("the \"{container_name}\" flow is killed")
-def step_impl(context: MinifiTestContext, container_name: str):
+def kill_flow(context: MinifiTestContext, container_name: str):
context.get_or_create_minifi_container(container_name).kill()
@step("the http proxy server is set up")
-def step_impl(context: MinifiTestContext):
+def setup_http_proxy(context: MinifiTestContext):
context.containers["http-proxy"] = HttpProxy(context)
@step("a NiFi container is set up")
-def step_impl(context: MinifiTestContext):
+def setup_nifi_container(context: MinifiTestContext):
context.containers["nifi"] = NifiContainer(context)
@step("a NiFi container is set up with SSL enabled")
-def step_impl(context: MinifiTestContext):
+def setup_nifi_container_with_ssl(context: MinifiTestContext):
context.containers["nifi"] = NifiContainer(context, use_ssl=True)
@when('NiFi is started')
-def step_impl(context):
+def start_nifi(context):
assert context.containers["nifi"].deploy(context) or
context.containers["nifi"].log_app_output()
@step("{duration} later")
-def step_impl(context: MinifiTestContext, duration: str):
+def wait_duration_later(context: MinifiTestContext, duration: str):
Review Comment:
good catch
[review
changes](https://github.com/apache/nifi-minifi-cpp/pull/2144/commits/8db1c0e92203b25665e407adc5fb7033666a31d6)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]