Ejemplo n.º 1
0
 def test_qmark(self):
     params = sqlds.QMarkParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == '? ? ? ? ? ? ? ? ?')
     self.assertTrue(params.params == self.testparams)
Ejemplo n.º 2
0
 def test_numeric(self):
     params = sqlds.NumericParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == ':1 :2 :3 :4 :5 :6 :7 :8 :9')
     self.assertTrue(params.params == self.testparams)
Ejemplo n.º 3
0
 def test_numeric(self):
     params = sqlds.NumericParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == ':1 :2 :3 :4 :5 :6 :7 :8 :9')
     self.assertTrue(params.params == self.testparams)
Ejemplo n.º 4
0
 def test_qmark(self):
     params = sqlds.QMarkParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == '? ? ? ? ? ? ? ? ?')
     self.assertTrue(params.params == self.testparams)
Ejemplo n.º 5
0
 def test_named(self):
     params = sqlds.NamedParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == ':p0 :p1 :p2 :p3 :p4 :p5 :p6 :p7 :p8', query)
     self.assertTrue(
         params.params == dict(zip(['p0', 'p1', 'p2', 'p3', 'p4', 'p5',
                               'p6', 'p7', 'p8'], self.testparams)),
         repr(params.params))
Ejemplo n.º 6
0
 def test_named(self):
     params = sqlds.NamedParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = string.join(query, ' ')
     self.assertTrue(query == ':p0 :p1 :p2 :p3 :p4 :p5 :p6 :p7 :p8', query)
     self.assertTrue(
         params.params == dict(zip(['p0', 'p1', 'p2', 'p3', 'p4', 'p5',
                               'p6', 'p7', 'p8'], self.testparams)),
         repr(params.params))
Ejemplo n.º 7
0
 def test_pynamed(self):
     params = sqlds.PyFormatParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = ' '.join(query)
     self.assertTrue(query == '%(p0)s %(p1)s %(p2)s %(p3)s %(p4)s '
                     '%(p5)s %(p6)s %(p7)s %(p8)s', query)
     self.assertTrue(
         params.params == dict(zip(['p0', 'p1', 'p2', 'p3', 'p4', 'p5',
                               'p6', 'p7', 'p8'], self.testparams)),
         repr(params.params))
Ejemplo n.º 8
0
 def test_pynamed(self):
     params = sqlds.PyFormatParams()
     query = []
     for p in self.testparams:
         query.append(params.add_param(p))
     query = ' '.join(query)
     self.assertTrue(query == '%(p0)s %(p1)s %(p2)s %(p3)s %(p4)s '
                     '%(p5)s %(p6)s %(p7)s %(p8)s', query)
     self.assertTrue(
         params.params == dict(zip(['p0', 'p1', 'p2', 'p3', 'p4', 'p5',
                               'p6', 'p7', 'p8'], self.testparams)),
         repr(params.params))