Exemplo n.º 1
0
 def test_given_i_store_sql_query_result_under_name_single_elem_list(self):
     q = 'SELECT name FROM TestDb'
     sql.given_i_store_sql_query_result_under_name(self.ctx, q,
                                                   'sql_result_single',
                                                   self.general_conn)
     self.assertEquals(self.ctx.zato.user_ctx['sql_result_single'],
                       self.name)
Exemplo n.º 2
0
 def test_given_i_store_sql_query_result_under_name_multi_elem_list(self):
     id = util.rand_int()
     name = util.rand_string()
     value = util.rand_string()
     self.cursor.execute("INSERT INTO TestDB (id, name, value) VALUES (?,?,?)", (id, name, value))
     self.conn.commit()
     q = 'SELECT name FROM TestDb'
     sql.given_i_store_sql_query_result_under_name(self.ctx, q, 'sql_result_multi', self.general_conn)
     self.assertEquals(self.ctx.zato.user_ctx['sql_result_multi'], [(self.name,), (name,)])
Exemplo n.º 3
0
 def test_given_i_store_sql_query_result_under_name_multi_elem_list(self):
     id = util.rand_int()
     name = util.rand_string()
     value = util.rand_string()
     self.cursor.execute(
         "INSERT INTO TestDB (id, name, value) VALUES (?,?,?)",
         (id, name, value))
     self.conn.commit()
     q = 'SELECT name FROM TestDb'
     sql.given_i_store_sql_query_result_under_name(self.ctx, q,
                                                   'sql_result_multi',
                                                   self.general_conn)
     self.assertEquals(self.ctx.zato.user_ctx['sql_result_multi'],
                       [(self.name, ), (name, )])
Exemplo n.º 4
0
 def test_given_i_store_sql_query_result_under_name_single_elem_list(self):
     q = 'SELECT name FROM TestDb'
     sql.given_i_store_sql_query_result_under_name(self.ctx, q, 'sql_result_single', self.general_conn)
     self.assertEquals(self.ctx.zato.user_ctx['sql_result_single'], self.name)