def __eq__(self, other): if isinstance(other, QLDate): return QLBoolean(self.day == other.day and self.month == other.month and self.year == other.year) return QLBoolean(False)
def test_file(self, file): ast = self.__parser.parse(file, self.__lexer.lexer) if not self.__parser.errors: TypeVisitor(extract_identifier_types(ast)).visit(ast) model = extract_gui_model(ast) result_type, result_value = file.split('\n')[0].split()[-2:] correct_result = None if result_type == 'QLBoolean' and result_value == 'True': correct_result = QLBoolean(True) elif result_type == 'QLBoolean': correct_result = QLBoolean() elif result_type == 'QLDate': day, month, year = loads(result_value) correct_result = QLDate(day, month, year) elif result_type == 'QLDecimal': correct_result = QLDecimal(result_value) elif result_type == 'QLInteger': correct_result = QLInteger(result_value) elif result_type == 'QLMoney': correct_result = QLMoney(result_value) elif result_type == 'QLString': correct_result = QLString(result_value) expression_evaluator = ExpressionEvaluator(model) expression_evaluator.visit(ast.block[0].answer) return bool(expression_evaluator.result == correct_result)
def __ne__(self, other): return QLBoolean(not self == other)
def __eq__(self, other): if isinstance(other, QLInteger): return QLBoolean(self.value == other.value) return QLBoolean(False)
def __ge__(self, other): return QLBoolean(len(self.value) >= len(other.value))
def __lt__(self, other): return QLBoolean(len(self.value) < len(other.value))
def __init__(self): self.form = None self.condition = QLBoolean.get_literal_node(True)
def __ge__(self, other): return QLBoolean(self.value >= other.value and self.currency == other.currency)
def __ge__(self, other): return QLBoolean(self > other or self == other)
def __le__(self, other): return QLBoolean(self < other or self == other)
def __gt__(self, other): return QLBoolean(self.year > other.year or (self.month > other.month and self.year == other.year) or (self.day > other.day and self.month == other.month and self.year == other.year))
def __lt__(self, other): return QLBoolean(self.year < other.year or (self.month < other.month and self.year == other.year) or (self.day < other.day and self.month == other.month and self.year == other.year))
def evaluate(self): self.value = QLBoolean(not self.expression.value)
def __le__(self, other): return QLBoolean(self.value <= other.value)
def p_boolean_literal(production): """expression : FALSE | TRUE""" production[0] = BooleanNode(Metadata(production.lineno(1)), QLBoolean, QLBoolean(production[1]))
def __ge__(self, other): return QLBoolean(self.value >= other.value)
def __eq__(self, other): if isinstance(other, QLMoney): return QLBoolean(self.value == other.value and self.currency == other.currency) return QLBoolean(False)