Tests/scripts/hook_validations/image.py
def is_existing_image(self):
        """Check if the integration has an image."""
        is_image_in_yml = False
        is_image_in_package = False

        data_dictionary = get_yaml(self.file_path)

        if not data_dictionary:
            return False

        if data_dictionary.get('image'):
            is_image_in_yml = True

        if not re.match(INTEGRATION_REGEX, self.file_path, re.IGNORECASE):
            package_path = os.path.dirname(self.file_path)
            if is_image_in_yml:
                print_error("You have added an image in the yml "
                            "file, please update the package {}".format(package_path))
                return False
            image_path = glob.glob(package_path + '/*.png')
            if image_path:
                is_image_in_package = True

        if not (is_image_in_package or is_image_in_yml):
            print_error("You have failed to add an image in the yml/package for {}".format(self.file_path))
            self._is_valid = False
            return False

        return True
Check if the integration has an image.
Check if the integration has an image.
Check if the integration has an image .
def is_existing_image(self):
        is_image_in_yml = False
        is_image_in_package = False
        data_dictionary = get_yaml(self.file_path)
        if not data_dictionary:
            return False
        if data_dictionary.get('image'):
            is_image_in_yml = True
        if not re.match(INTEGRATION_REGEX, self.file_path, re.IGNORECASE):
            package_path = os.path.dirname(self.file_path)
            if is_image_in_yml:
                print_error("You have added an image in the yml "
                            "file, please update the package {}".format(package_path))
                return False
            image_path = glob.glob(package_path + '/*.png')
            if image_path:
                is_image_in_package = True
        if not (is_image_in_package or is_image_in_yml):
            print_error("You have failed to add an image in the yml/package for {}".format(self.file_path))
            self._is_valid = False
            return False
        return True
def is_existing_image ( self ) : is_image_in_yml = False is_image_in_package = False data_dictionary = get_yaml ( self . file_path ) if not data_dictionary : return False if data_dictionary . get ( 'image' ) : is_image_in_yml = True if not re . match ( INTEGRATION_REGEX , self . file_path , re . IGNORECASE ) : package_path = os . path . dirname ( self . file_path ) if is_image_in_yml : print_error ( "You have added an image in the yml " "file, please update the package {}" . format ( package_path ) ) return False image_path = glob . glob ( package_path + '/*.png' ) if image_path : is_image_in_package = True if not ( is_image_in_package or is_image_in_yml ) : print_error ( "You have failed to add an image in the yml/package for {}" . format ( self . file_path ) ) self . _is_valid = False return False return True
Check if the integration has an image.
Check if the integration has an image .
"""Check if the integration has an image."""
self