'Test parenthesis precedence.'

def testParser(self):

    ast = lexer.SearchParser('    (\'file    name\'    contains    "foo")    and    (size    >    100k\nor    date    before    "2011-10")').Parse()
    self.assertEqual(ast.operator, 'and')
    self.assertEqual(ast.args[0].attribute, 'file    name')
    self.assertEqual(ast.args[0].operator, 'contains')
    self.assertEqual(ast.args[0].args[0], 'foo')
    self.assertEqual(ast.args[1].operator, 'or')
    self.assertEqual(ast.args[1].args[0].attribute, 'size')
    self.assertEqual(ast.args[1].args[0].operator, '>')
    self.assertEqual(ast.args[1].args[0].args[0], '100k')
    self.assertEqual(ast.args[1].args[1].attribute, 'date')
    self.assertEqual(ast.args[1].args[1].operator, 'before')
    self.assertEqual(ast.args[1].args[1].args[0], '2011-10')
