Exemple #1
0
    def __init__(
        self, dcp, profile=get_default_profile(), ov_path=None,
        hash_callback=None
    ):
        """ DCPChecker constructor.

            Args:
                dcp (clairmeta.DCP): DCP object.
                profile (dict): Checker profile.
                ov_path (str, optional): Absolute path of OriginalVersion DCP.

        """
        super(DCPChecker, self).__init__(dcp, profile)
        self.ov_path = ov_path
        self.ov_dcp = None

        self.hash_callback = hash_callback
        if not self.hash_callback:
            pass
        elif isinstance(self.hash_callback, ConsoleProgress):
            self.hash_callback._total_size = self.dcp.size
        elif inspect.isclass(self.hash_callback):
            raise CheckException(
                "Invalid callback, please provide a function"
                " or instance of ConsoleProgress (or derivate).")

        self.check_modules = {}
        self.load_modules()
Exemple #2
0
    def __init__(self,
                 dcp,
                 profile=get_default_profile(),
                 ov_path=None,
                 hash_callback=None):
        """ DCPChecker constructor.

            Args:
                dcp (clairmeta.DCP): DCP object.
                profile (dict): Checker profile.
                ov_path (str, optional): Absolute path of OriginalVersion DCP.

        """
        super(DCPChecker, self).__init__(dcp, profile)
        self.ov_path = ov_path
        self.hash_callback = hash_callback

        self.check_modules = {}
        self.load_modules()
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super(CheckerTestBase, self).__init__(*args, **kwargs)
     disable_log()
     self.profile = get_default_profile()
Exemple #4
0
 def test_save_profile(self):
     with temporary_file(suffix='.json') as f:
         p_gold = get_default_profile()
         save_profile(p_gold, f)
         p = load_profile(f)
         self.assertEqual(p, p_gold)
Exemple #5
0
 def __init__(self, *args, **kwargs):
     super(CheckerTestBase, self).__init__(*args, **kwargs)
     disable_log()
     self.profile = get_default_profile()
     self.profile['bypass'] = ['check_assets_pkl_hash']