def _check_args(self, regex=None, match_type=None, threshold=None, expected=None):
    try:
        re.compile(regex)
    except (ValueError, sre_constants.error) as err:
        raise result_parsers.ResultParserError('Invalid regular expression: {}'.format(err))
    if (not isinstance(expected, list)):
        raise result_parsers.ResultParserError('Expected should be a list.')
    if threshold:
        try:
            int(threshold)
        except ValueError as err:
            raise result_parsers.ResultParserError("Non-integer value provided for 'threshold'.")
        if (int(threshold) < 0):
            raise result_parsers.ResultParserError("'threshold' must be a non-negative integer.")
        if expected:
            raise result_parsers.ResultParserError("'threshold' and 'expected' cannot be used at the same time.")
    for item in expected:
        test_list = []
        if (':' in item):
            test_list = list(self.range_re.search(item).groups())
        else:
            test_list = [item]
        none_used = False
        for test_item in test_list:
            if (test_item is ''):
                if (not none_used):
                    none_used = True
                else:
                    raise result_parsers.ResultParserError('No values provided in range: {}'.format(test_list))
            else:
                try:
                    float(test_item)
                except ValueError as err:
                    raise result_parsers.ResultParserError('Invalid value: {}'.format(test_item))
        if (len(test_list) > 1):
            if ('.' in test_list[0]):
                low = float(test_list[0])
            elif (test_list[0] != ''):
                low = int(test_list[0])
            if ('.' in test_list[1]):
                high = float(test_list[1])
            elif (test_list[1] != ''):
                high = int(test_list[1])
            if (('' not in test_list) and (high < low)):
                raise result_parsers.ResultParserError('Invalid range: {}'.format(item))
def _check_args(self, regex=None, match_type=None, threshold=None, expected=None):
    try:
        re.compile(regex)
    except (ValueError, sre_constants.error) as err:
        raise result_parsers.ResultParserError('Invalid regular expression: {}'.format(err))
    if (not isinstance(expected, list)):
        raise result_parsers.ResultParserError('Expected should be a list.')
    if threshold:
        try:
            int(threshold)
        except ValueError as err:
            raise result_parsers.ResultParserError("Non-integer value provided for 'threshold'.")
        if (int(threshold) < 0):
            raise result_parsers.ResultParserError("'threshold' must be a non-negative integer.")
        if expected:
            raise result_parsers.ResultParserError("'threshold' and 'expected' cannot be used at the same time.")
    for item in expected:
        test_list = []
        if (':' in item):
            test_list = list(self.range_re.search(item).groups())
        else:
            test_list = [item]
        none_used = False
        for test_item in test_list:
            if (test_item is ):
                if (not none_used):
                    none_used = True
                else:
                    raise result_parsers.ResultParserError('No values provided in range: {}'.format(test_list))
            else:
                try:
                    float(test_item)
                except ValueError as err:
                    raise result_parsers.ResultParserError('Invalid value: {}'.format(test_item))
        if (len(test_list) > 1):
            if ('.' in test_list[0]):
                low = float(test_list[0])
            elif (test_list[0] != ):
                low = int(test_list[0])
            if ('.' in test_list[1]):
                high = float(test_list[1])
            elif (test_list[1] != ):
                high = int(test_list[1])
            if (( not in test_list) and (high < low)):
                raise result_parsers.ResultParserError('Invalid range: {}'.format(item))