def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_expression = expressions.GreaterThan(self.test_location, 5, 4) self.test_block = block.Block(self.test_location, []) self.test_if = ql_statements.If(self.test_location, self.test_expression, self.test_block)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_expression_1 = expressions.GreaterThan(self.test_location, 5, 4) self.test_expression_2 = expressions.Addition(self.test_location, 2, 2) self.test_binary_expression = expressions.BinaryExpression(self.test_location, self.test_expression_1, self.test_expression_2)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_identifier = "identifier" self.test_text = "text" self.test_type = "boolean" self.test_question = ql_statements.Question(self.test_location, self.test_identifier, self.test_text, self.test_type)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_identifier = "identifier" self.test_text = "text" self.test_type = "boolean" self.test_expression = expressions.GreaterThan(self.test_location, 5, 4) self.test_computed_question = ql_statements.ComputedQuestion( self.test_location, self.test_identifier, self.test_text, self.test_type, self.test_expression)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_expression_1 = expressions.GreaterThan(self.test_location, 5, 4) self.test_expression_2 = expressions.Addition(self.test_location, 2, 2) self.expressions = [expressions.Multiplication, expressions.Division, expressions.Addition, expressions.Subtraction, expressions.GreaterThan, expressions.LessThan, expressions.GreaterThanOrEqual, expressions.LessThanOrEqual, expressions.Equals, expressions.NotEquals, expressions.And, expressions.Or] self.test_expressions = [] for expression in self.expressions: self.test_expressions.append(expression(self.test_location, self.test_expression_1, self.test_expression_2))
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_identifier = "identifier" self.test_block = block.Block(self.test_location, []) self.test_form = form.Form(self.test_location, self.test_identifier, self.test_block)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_statements = [] self.test_block = block.Block(self.test_location, self.test_statements)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_statement = statement.Statement(self.test_location)
super().__init__(location) self._value = value self._type = type @property def value(self): return self._value @value.setter def value(self, value): self._value = value @property def type(self): return self._type def __eq__(self, other): return self.__dict__ == other.__dict__ def __repr__(self): return str(self._value) if __name__ == "__main__": loc = code_location.CodeLocation(2, 3) b = And(2, "left", "right") # c = Not(loc, b) c = "True" == "True" print(c) # print(c)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_literal = expressions.Literal(self.test_location)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_expression = expressions.Expression(self.test_location)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_expression = expressions.GreaterThan(self.test_location, 5, 4) self.test_unary_expression = expressions.UnaryExpression(self.test_location, self.test_expression)
def setUp(self): self.test_location = code_location.CodeLocation(1, 1) self.test_identifier = "identifier" self.test_identifier_class = expressions.Identifier(self.test_location, self.test_identifier)