fgerlits commented on code in PR #2061:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2061#discussion_r2592707683


##########
behave_framework/src/minifi_test_framework/containers/container.py:
##########
@@ -279,10 +282,24 @@ def _verify_file_contents_in_running_container(self, 
directory_path: str, expect
             if exit_code != 0:
                 error_message = f"Command to read file '{path}' failed with 
exit code {exit_code}"
                 logging.error(error_message)
-                return False
+                return None
 
             actual_file_contents.append(content)
 
+        return actual_file_contents
+
+    def _verify_file_contents_in_running_container(self, directory_path: str, 
expected_contents: list[str]) -> bool:
+        if not self.not_empty_dir_exists(directory_path):

Review Comment:
   nitpicking, and belongs to a previous PR, but the name of this function 
should be
   ```suggestion
           if not self.nonempty_dir_exists(directory_path):
   ```



##########
extensions/standard-processors/tests/features/steps/steps.py:
##########
@@ -33,3 +35,19 @@ def step_impl(context: MinifiTestContext):
 @step("a Syslog client with UDP protocol is setup to send logs to minifi")
 def step_impl(context):
     context.containers["syslog-udp"] = SyslogContainer("udp", context)
+
+
+@step(u'there is an accessible PLC with modbus enabled')

Review Comment:
   the `u` is a leftover from Python 2, I think, and can be removed



##########
behave_framework/src/minifi_test_framework/steps/core_steps.py:
##########
@@ -58,6 +59,17 @@ def step_impl(context: MinifiTestContext, file_name: str, 
content: str, path: st
     
context.get_or_create_default_minifi_container().files.append(File(os.path.join(path,
 file_name), new_content))
 
 
+@step('a file with the content "{content}" is present in "{path}"')
+def step_impl(context: MinifiTestContext, content: str, path: str):
+    new_content = content.replace("\\n", "\n")
+    
context.get_or_create_default_minifi_container().files.append(File(os.path.join(path,
 str(uuid.uuid4())), new_content))

Review Comment:
   this sounds more like a `@given` than a `@step` (also the two blocks before 
it)



##########
extensions/standard-processors/tests/features/file_system_operations.feature:
##########
@@ -19,49 +19,57 @@ Feature: File system operations are handled by the GetFile, 
PutFile, ListFile an
   As a user of MiNiFi
   I need to have GetFile, PutFile, ListFile and FetchFile processors
 
-  Background:
-    Given the content of "/tmp/output" is monitored
-
   Scenario: Get and put operations run in a simple flow
     Given a GetFile processor with the "Input Directory" property set to 
"/tmp/input"
     And a file with the content "test" is present in "/tmp/input"
     And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And PutFile is EVENT_DRIVEN
     And the "success" relationship of the GetFile processor is connected to 
the PutFile
+    And PutFile's success relationship is auto-terminated
     When the MiNiFi instance starts up
-    Then a flowfile with the content "test" is placed in the monitored 
directory in less than 10 seconds
+    Then there is a single file with "test" content in the "/tmp/output" 
directory in less than 10 seconds
 
   Scenario: PutFile does not overwrite a file that already exists
-    Given a set of processors:
-      | type    | name      | uuid                                 |
-      | GetFile | GetFile   | 66259995-11da-41df-bff7-e262d5f6d7c9 |
-      | PutFile | PutFile_1 | 694423a0-26f3-4e95-9f9f-c03b6d6c189d |
-      | PutFile | PutFile_2 | f37e51e9-ad67-4e16-9dc6-ad853b0933e3 |
-      | PutFile | PutFile_3 | f37e51e9-ad67-4e16-9dc6-ad853b0933e4 |
+    Given a GetFile processor with the "Input Directory" property set to 
"/tmp/input"
+    And a PutFile processor with the name "PutFile_1"
+    And PutFile_1 is EVENT_DRIVEN
+    And a PutFile processor with the name "PutFile_2"
+    And PutFile_2 is EVENT_DRIVEN
+    And a PutFile processor with the name "PutFile_3"
+    And PutFile_3 is EVENT_DRIVEN
 
-    And these processor properties are set:
+    And these processor properties are set
       | processor name | property name   | property value |
       | GetFile        | Input Directory | /tmp/input     |
-      | PutFile_1      | Input Directory | /tmp           |
+      | PutFile_1      | Directory       | /tmp           |

Review Comment:
   interesting -- how was this working before? PutFile has no InputDirectory 
property



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