コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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))
コード例 #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)
コード例 #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)
コード例 #8
0
ファイル: test_statement.py プロジェクト: njtromp/endless-ql
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_statement = statement.Statement(self.test_location)
コード例 #9
0
ファイル: expressions.py プロジェクト: njtromp/endless-ql
        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)
コード例 #10
0
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_literal = expressions.Literal(self.test_location)
コード例 #11
0
 def setUp(self):
     self.test_location = code_location.CodeLocation(1, 1)
     self.test_expression = expressions.Expression(self.test_location)
コード例 #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)
コード例 #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)