def match()

in custom_image_cli/validation_tool/validation_tests/check_files.py [0:0]


    def match(self, name, path, file_prefixes):
        local_test_pass = True
        docker_log = self.docker_cmd.docker_list_files(self.docker_image_uri, path)
        files = docker_log.decode().split('\n')[1:]
        for prefix in file_prefixes:
            is_match = False
            for file in files:
                if file.startswith(prefix):
                    is_match = True
                    break
            if not is_match:
                self.log.error("%s MUST be in %s : FAIL" % (prefix, path))
                local_test_pass = False

        if local_test_pass:
            self.log.info("File Structure Test for %s in %s: PASS" % (name, path))
        return local_test_pass