• Home
  • Raw
  • Download

Lines Matching refs:row

32 def dict_factory(cursor, row):  argument
35 d[col[0]] = row[idx]
83 row = cur.fetchone()
84 self.assertIsInstance(row, dict)
95 self.con.row_factory = lambda cur, row: list(row)
96 row = self.con.execute("select 1, 2").fetchone()
97 self.assertIsInstance(row, list)
101 row = self.con.execute("select 1 as a, 2 as b").fetchone()
102 self.assertIsInstance(row, sqlite.Row)
104 col1, col2 = row["a"], row["b"]
108 col1, col2 = row["A"], row["B"]
112 self.assertEqual(row[0], 1, "by index: wrong result for column 0")
113 self.assertEqual(row[0L], 1, "by index: wrong result for column 0")
114 self.assertEqual(row[1], 2, "by index: wrong result for column 1")
115 self.assertEqual(row[1L], 2, "by index: wrong result for column 1")
116 self.assertEqual(row[-1], 2, "by index: wrong result for column -1")
117 self.assertEqual(row[-1L], 2, "by index: wrong result for column -1")
118 self.assertEqual(row[-2], 1, "by index: wrong result for column -2")
119 self.assertEqual(row[-2L], 1, "by index: wrong result for column -2")
122 row['c']
124 row[2]
126 row[2L]
128 row[-3]
130 row[-3L]
132 row[2**1000]
137 row = self.con.execute("select 1 as a, 2 as b").fetchone()
138 for col in row:
144 row = self.con.execute("select 1 as a, 2 as b").fetchone()
145 t = tuple(row)
146 self.assertEqual(t, (row['a'], row['b']))
151 row = self.con.execute("select 1 as a, 2 as b").fetchone()
152 d = dict(row)
153 self.assertEqual(d["a"], row["a"])
154 self.assertEqual(d["b"], row["b"])
179 row = self.con.execute("select 1 as a, 2 as b").fetchone()
181 as_tuple = tuple(row)
182 self.assertEqual(list(reversed(row)), list(reversed(as_tuple)))
183 self.assertIsInstance(row, Sequence)
204 row = self.con.execute("select ?", (austria,)).fetchone()
205 self.assertEqual(type(row[0]), unicode, "type of row[0] must be unicode")
210 row = self.con.execute("select ?", (austria,)).fetchone()
211 self.assertEqual(type(row[0]), str, "type of row[0] must be str")
212 … self.assertEqual(row[0], austria.encode("utf-8"), "column must equal original data in UTF-8")
217 row = self.con.execute("select ?", (austria.encode("latin1"),)).fetchone()
218 self.assertEqual(type(row[0]), unicode, "type of row[0] must be unicode")
219 self.assertTrue(row[0].endswith(u"reich"), "column must contain original data")
241 row = self.con.execute("select value from test").fetchone()
242 self.assertIs(type(row[0]), unicode)
243 self.assertEqual(row[0], "a\x00b")
248 row = self.con.execute("select value from test").fetchone()
249 self.assertIs(type(row[0]), str)
250 self.assertEqual(row[0], "a\x00b")
255 row = self.con.execute("select value from test").fetchone()
256 self.assertIs(type(row[0]), str)
257 self.assertEqual(row[0], "a\x00b")
264 row = self.con.execute("select value from test").fetchone()
265 self.assertIs(type(row[0]), unicode)
266 self.assertEqual(row[0], u"�\x00�")