예제 #1
0
 def testGqlAncestor(self):
   qry, options, bindings = query.parse_gql(
     'SELECT * FROM Kind WHERE ANCESTOR IS :1')
   self.assertEqual(qry.kind, 'Kind')
   self.assertEqual(qry.ancestor, query.Binding(None, 1))
   self.assertEqual(qry.filters, None)
   self.assertEqual(qry.orders, None)
   self.assertEqual(bindings, {1: query.Binding(None, 1)})
예제 #2
0
 def testGqlBindings(self):
   qry, options, bindings = query.parse_gql(
     'SELECT * FROM Kind WHERE prop1 = :1 AND prop2 = :foo')
   self.assertEqual(qry.kind, 'Kind')
   self.assertEqual(qry.ancestor, None)
   self.assertEqual(qry.filters,
                    query.ConjunctionNode(
                      [query.FilterNode('prop1', '=',
                                        query.Binding(None, 1)),
                       query.FilterNode('prop2', '=',
                                        query.Binding(None, 'foo'))]))
   self.assertEqual(qry.orders, None)
   self.assertEqual(bindings, {1: query.Binding(None, 1),
                               'foo': query.Binding(None, 'foo')})