def test_parses_comma_separated_group_as_or_expression(self):
        tags = TagExpression()
        node = tags.parse('@tag_1,~@tag_2,@tag_3')

        node |should| be_instance_of(OrNode)

        node_1, node_2, node_3 = node.child_nodes

        node_1 |should| be_instance_of(TagNode)
        node_1.name |should| be_equal_to('tag_1')

        node_2 |should| be_instance_of(NegationNode)
        node_2.child |should| be_instance_of(TagNode)
        node_2.child.name |should| be_equal_to('tag_2')

        node_3 |should| be_instance_of(TagNode)
        node_3.name |should| be_equal_to('tag_3')
Example #2
0
    def test_parses_comma_separated_group_as_or_expression(self):
        tags = TagExpression()
        node = tags.parse('@tag_1,~@tag_2,@tag_3')

        node | should | be_instance_of(OrNode)

        node_1, node_2, node_3 = node.child_nodes

        node_1 | should | be_instance_of(TagNode)
        node_1.name | should | be_equal_to('tag_1')

        node_2 | should | be_instance_of(NegationNode)
        node_2.child | should | be_instance_of(TagNode)
        node_2.child.name | should | be_equal_to('tag_2')

        node_3 | should | be_instance_of(TagNode)
        node_3.name | should | be_equal_to('tag_3')
 def test_parses_negated_tag(self):
     tags = TagExpression()
     node = tags.parse('~@tag_name')
     node |should| be_instance_of(NegationNode)
     node.child |should| be_instance_of(TagNode)
     node.child.name |should| be_equal_to('tag_name')
 def test_parses_tag(self):
     tags = TagExpression()
     node = tags.parse('@tag_name')
     node |should| be_instance_of(TagNode)
     node.name |should| be_equal_to('tag_name')
Example #5
0
 def test_parses_negated_tag(self):
     tags = TagExpression()
     node = tags.parse('~@tag_name')
     node | should | be_instance_of(NegationNode)
     node.child | should | be_instance_of(TagNode)
     node.child.name | should | be_equal_to('tag_name')
Example #6
0
 def test_parses_tag(self):
     tags = TagExpression()
     node = tags.parse('@tag_name')
     node | should | be_instance_of(TagNode)
     node.name | should | be_equal_to('tag_name')