lordgamez commented on code in PR #2059:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2059#discussion_r2661341950


##########
behave_framework/src/minifi_test_framework/steps/checking_steps.py:
##########
@@ -152,3 +171,28 @@ def step_impl(context: MinifiTestContext, max_increase: 
str, duration: str):
     time.sleep(time_in_seconds)
     final_memory_usage = 
context.get_default_minifi_container().get_memory_usage()
     assert final_memory_usage - initial_memory_usage <= max_increase_in_bytes
+
+
+@then('after a wait of {duration}, at least {lower_bound:d} and at most 
{upper_bound:d} flowfiles are produced and placed in the "{directory}" 
directory')
+def step_impl(context, lower_bound, upper_bound, duration, directory):
+    duration_seconds = humanfriendly.parse_timespan(duration)
+    assert check_condition_after_wait(condition=lambda: 
context.get_default_minifi_container().get_number_of_files(directory) >= 
lower_bound
+                                      and 
context.get_default_minifi_container().get_number_of_files(directory) <= 
upper_bound,
+                                      context=context, 
wait_time=duration_seconds)
+
+
+@then('exactly these files are in the "{directory}" directory in less than 
{duration}: "{contents}"')
+def step_impl(context, directory, duration, contents):
+    if not contents:
+        context.execute_steps(f'then no files are placed in the "{directory}" 
directory in {duration} of running time')
+        return
+    contents_arr = contents.split(",")
+    timeout_in_seconds = humanfriendly.parse_timespan(duration)
+    assert wait_for_condition(condition=lambda: 
context.get_default_minifi_container().verify_file_contents(directory, 
contents_arr),
+                              timeout_seconds=timeout_in_seconds, 
bail_condition=lambda: False,
+                              context=context)
+
+
+@then('exactly these files are in the "{directory}" directory in less than 
{duration}: ""')

Review Comment:
   It is actually used that way in this specific scenario when no content is 
set. It calls "no files are placed" step which waits for the set amount of 
time. This step only uses this type of phrasing to be used in a single scenario 
outline together with other use case parameters.



-- 
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]

Reply via email to