From 95feff15095dd0d3dbb9fd4a4764a2b813b282a3 Mon Sep 17 00:00:00 2001 From: Andy Ragusa Date: Fri, 28 Jun 2024 07:18:27 -0700 Subject: [PATCH] blah --- unit_tests/testcase.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/unit_tests/testcase.py b/unit_tests/testcase.py index 494c2ded27..172dd22c59 100644 --- a/unit_tests/testcase.py +++ b/unit_tests/testcase.py @@ -508,6 +508,20 @@ def execute_command(self, cmd, **kwargs): """ return self.execute(cmd, **kwargs) + # Find the metadata.json file and verify its contents. + def verify_metadata_json(self, tempdir, expected=[], unexpected=[]): + for parent, dirs, files in os.walk(tempdir): + for f in files: + if "metadata.json" == f: + with open(os.path.join(parent, f)) as handle: + metadata_json = handle.read() + self.verify_output(metadata_json, expected=expected, unexpected=unexpected) + + # There is only one metadata.json per scan. + # We found it, so we can break out of the loop. + break + + class Logger(object):