hunyadi-dev commented on a change in pull request #1053:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1053#discussion_r626384273



##########
File path: docker/test/integration/minifi/validators/FileOutputValidator.py
##########
@@ -1,9 +1,47 @@
+import logging
+import os
+
+from os import listdir
+from os.path import join
+
 from .OutputValidator import OutputValidator
 
 
 class FileOutputValidator(OutputValidator):
     def set_output_dir(self, output_dir):
         self.output_dir = output_dir
 
+    @staticmethod
+    def num_files_matching_content_in_dir(dir_path, expected_content):
+        listing = listdir(dir_path)
+        if not listing:
+            return 0
+        files_of_matching_content_found = 0
+        for file_name in listing:
+          full_path = join(dir_path, file_name)
+          if not os.path.isfile(full_path):
+              continue
+          with open(full_path, 'r') as out_file:
+              contents = out_file.read()
+              logging.info("dir %s -- name %s", dir_path, file_name)
+              logging.info("expected content: %s -- actual: %s, match: %r", 
expected_content, contents, expected_content == contents)
+              if expected_content in contents:

Review comment:
       Updated to the latter.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to