arpadboda commented on a change in pull request #615: MINIFICPP-963 - Zero byte
(no content) flow files cannot be received …
URL: https://github.com/apache/nifi-minifi-cpp/pull/615#discussion_r319973339
##########
File path: docker/test/integration/minifi/test/__init__.py
##########
@@ -207,27 +213,58 @@ def __init__(self, expected_content):
self.valid = False
self.expected_content = expected_content
- def set_output_dir(self, output_dir):
- self.output_dir = output_dir
-
def validate(self):
if self.valid:
return True
listing = listdir(self.output_dir)
- if len(listing) > 0:
+ if listing:
out_file_name = listing[0]
with open(join(self.output_dir, out_file_name), 'r') as out_file:
contents = out_file.read()
if contents == self.expected_content:
self.valid = True
- return True
- return False
+ return self.valid
+
+class EmptyFilesOutPutValidator(FileOutputValidator):
+ """
+ Validates if all the files in the target directory are empty and at least
one exists
+ """
+ def __init__(self):
+ self.valid = False
+
+ def validate(self):
+
+ if self.valid:
+ return True
+
+ listing = listdir(self.output_dir)
+ if listing:
+ self.valid = all(os.path.getsize(os.path.join(self.output_dir,x))
== 0 for x in listing)
Review comment:
I take it as a compliment
----------------------------------------------------------------
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]
With regards,
Apache Git Services