Beispiel #1
0
 def __init__(self, name, params, test_dir):
     """
   Initializer for the class. Takes a String name and a dictionary params
   @ In, name, string, name of the test.
   @ In, params, dictionary, parameters for the class
   @ In, test_dir, string, path to the test.
   @ Out, None.
 """
     Differ.__init__(self, name, params, test_dir)
Beispiel #2
0
 def __init__(self, name, params, test_dir):
     """
   Initializer for the class. Takes a String name and a dictionary params
   @ In, name, string, name of the test.
   @ In, params, dictionary, parameters for the class
   @ In, test_dir, string, path to the test.
   @ Out, None.
 """
     Differ.__init__(self, name, params, test_dir)
     self.__zero_threshold = self.specs['zero_threshold']
     if len(self.specs['rel_err']) > 0:
         self.__rel_err = float(self.specs['rel_err'])
     else:
         self.__rel_err = 1e-10
Beispiel #3
0
 def __init__(self, name, params, testDir):
     """
   Initializer for the class. Takes a String name and a dictionary params
   @ In, name, string, name of the test.
   @ In, params, dictionary, parameters for the class
   @ In, testDir, string, path to the test.
   @ Out, None.
 """
     Differ.__init__(self, name, params, testDir)
     self._zero_threshold = self.specs['zero_threshold']
     self._ignore_sign = bool(self.specs['ignore_sign'])
     if len(self.specs['rel_err']) > 0:
         self._rel_err = float(self.specs['rel_err'])
     else:
         self._rel_err = 1e-10
     self._check_absolute_value = self.specs["check_absolute_value"]
Beispiel #4
0
 def get_valid_params():
     """
   Return the valid parameters for this class.
   @ In, None
   @ Out, params, _ValidParameters, return the parameters.
 """
     params = Differ.get_valid_params()
     return params
Beispiel #5
0
 def __init__(self, name, params, test_dir):
   """
     Initializer for the class. Takes a String name and a dictionary params
     @ In, name, string, name of the test.
     @ In, params, dictionary, parameters for the class
     @ In, test_dir, string, path to the test.
     @ Out, None.
   """
   Differ.__init__(self, name, params, test_dir)
   self.__xmlopts = {}
   if len(self.specs["rel_err"]) > 0:
     self.__xmlopts['rel_err'] = float(self.specs["rel_err"])
   self.__xmlopts['zero_threshold'] = float(self.specs["zero_threshold"])
   self.__xmlopts['unordered'] = bool(self.specs["unordered"])
   self.__xmlopts['remove_whitespace'] = bool(self.specs['remove_whitespace'])
   self.__xmlopts['remove_unicode_identifier'] = self.specs['remove_unicode_identifier']
   if len(self.specs['xmlopts']) > 0:
     self.__xmlopts['xmlopts'] = self.specs['xmlopts'].split(' ')
Beispiel #6
0
 def get_valid_params():
   """
     Returns the parameters that this class can use.
     @ In, None
     @ Out, params, _ValidParameters, return the parameters.
   """
   params = Differ.get_valid_params()
   params.add_param('comment', '-20021986', "Character or string denoting "+
                    "comments, all text to the right of the symbol will be "+
                    "ignored in the diff of text files")
   return params
Beispiel #7
0
 def get_valid_params():
   """
     Returns the valid parameters for this class.
     @ In, None
     @ Out, params, _ValidParameters, return the parameters.
   """
   params = Differ.get_valid_params()
   params.add_param('rel_err', '', 'Relative Error for image files')
   params.add_param('zero_threshold', sys.float_info.min*4.0,
                    'it represents the value below which a float is '+
                    'considered zero in the pixel comparison')
   return params
Beispiel #8
0
 def get_valid_params():
   """
     Returns the valid parameters for this class.
     @ In, None
     @ Out, params, _ValidParameters, return the parameters.
   """
   params = Differ.get_valid_params()
   params.add_param('rel_err', '', 'Relative Error for csv files')
   params.add_param('zero_threshold', sys.float_info.min*4.0,
                    'it represents the value below which a float is '+
                    'considered zero (XML comparison only)')
   params.add_param('ignore_sign', False, 'if true, then only compare the absolute values')
   params.add_param('check_absolute_value', False, 'if true the values are '+
                    'compared to the tolerance directectly, instead of relatively.')
   return params
Beispiel #9
0
 def get_valid_params():
   """
     Return the valid parameters for this class.
     @ In, None
     @ Out, params, _ValidParameters, return the parameters.
   """
   params = Differ.get_valid_params()
   params.add_param('unordered', False, 'if true allow the tags in any order')
   params.add_param('zero_threshold', sys.float_info.min*4.0, 'it represents '
                    +'the value below which a float is considered zero (XML comparison only)')
   params.add_param('remove_whitespace', False,
                    'Removes whitespace before comparing xml node text if True')
   params.add_param('remove_unicode_identifier', False,
                    'if true, then remove u infront of a single quote')
   params.add_param('xmlopts', '', "Options for xml checking")
   params.add_param('rel_err', '', 'Relative Error for csv files or floats in xml ones')
   return params