Lines Matching refs:con
44 self.con = sqlite.connect(":memory:", factory=MyConnection)
47 self.con.close()
50 self.assertIsInstance(self.con, MyConnection)
54 self.con = sqlite.connect(":memory:")
57 self.con.close()
60 cur = self.con.cursor()
62 cur = self.con.cursor(MyCursor)
64 cur = self.con.cursor(factory=lambda con: MyCursor(con))
69 self.assertRaises(TypeError, self.con.cursor, None)
71 self.assertRaises(TypeError, self.con.cursor, lambda: None)
73 self.assertRaises(TypeError, self.con.cursor, lambda con: None)
77 self.con = sqlite.connect(":memory:")
80 cur = self.con.cursor(factory=MyCursor)
87 self.con.close()
91 self.con = sqlite.connect(":memory:")
94 self.con.row_factory = lambda cur, row: list(row)
95 row = self.con.execute("select 1, 2").fetchone()
99 self.con.row_factory = sqlite.Row
100 row = self.con.execute("select 1 as a_1, 2 as b").fetchone()
128 self.con.row_factory = sqlite.Row
129 row = self.con.execute("select 1 as \xff").fetchone()
138 self.con.row_factory = sqlite.Row
139 row = self.con.execute("select 1, 2, 3, 4").fetchone()
156 self.con.row_factory = sqlite.Row
157 row = self.con.execute("select 1 as a, 2 as b").fetchone()
163 self.con.row_factory = sqlite.Row
164 row = self.con.execute("select 1 as a, 2 as b").fetchone()
170 self.con.row_factory = sqlite.Row
171 row = self.con.execute("select 1 as a, 2 as b").fetchone()
178 self.con.row_factory = sqlite.Row
179 row_1 = self.con.execute("select 1 as a, 2 as b").fetchone()
180 row_2 = self.con.execute("select 1 as a, 2 as b").fetchone()
181 row_3 = self.con.execute("select 1 as a, 3 as b").fetchone()
182 row_4 = self.con.execute("select 1 as b, 2 as a").fetchone()
183 row_5 = self.con.execute("select 2 as b, 1 as a").fetchone()
212 self.con.row_factory = sqlite.Row
213 row = self.con.execute("select 1 as a, 2 as b").fetchone()
225 self.con.row_factory = sqlite.Row
226 self.assertRaises(TypeError, self.con.cursor, FakeCursor)
230 self.con.close()
234 self.con = sqlite.connect(":memory:")
238 row = self.con.execute("select ?", (austria,)).fetchone()
242 self.con.text_factory = bytes
244 row = self.con.execute("select ?", (austria,)).fetchone()
249 self.con.text_factory = lambda x: str(x, "utf-8", "ignore")
251 row = self.con.execute("select ?", (austria,)).fetchone()
258 self.con.text_factory = sqlite.OptimizedUnicode
262 a_row = self.con.execute("select ?", (austria,)).fetchone()
263 d_row = self.con.execute("select ?", (germany,)).fetchone()
268 self.con.close()
272 self.con = sqlite.connect(":memory:")
273 self.con.execute("create table test (value text)")
274 self.con.execute("insert into test (value) values (?)", ("a\x00b",))
278 row = self.con.execute("select value from test").fetchone()
283 self.con.text_factory = bytes
284 row = self.con.execute("select value from test").fetchone()
289 self.con.text_factory = bytearray
290 row = self.con.execute("select value from test").fetchone()
296 self.con.text_factory = lambda x: x
297 row = self.con.execute("select value from test").fetchone()
302 self.con.close()