Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
    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))
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_statement = statement.Statement(self.test_location)
Esempio n. 9
0
        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)
Esempio n. 10
0
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_literal = expressions.Literal(self.test_location)
Esempio n. 11
0
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_expression = expressions.Expression(self.test_location)
Esempio n. 12
0
 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)
Esempio n. 13
0
 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)