| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -179,8 +179,14 @@ def test_sqlite_row_iter(self): | |||
| 179 | 179 | """Checks if the row object is iterable""" | |
| 180 | 180 | self.con.row_factory = sqlite.Row | |
| 181 | 181 | row = self.con.execute("select 1 as a, 2 as b").fetchone() | |
| 182 | - for col in row: | ||
| 183 | - pass | ||
| 182 | + | ||
| 183 | + # Iterable in correct order and produce valid results: | ||
| 184 | + items = [col for col in row] | ||
| 185 | + self.assertEqual(items, [1, 2]) | ||
| 186 | + | ||
| 187 | + # Is iterable the second time: | ||
| 188 | + items = [col for col in row] | ||
| 189 | + self.assertEqual(items, [1, 2]) | ||
| 184 | 190 | ||
| 185 | 191 | def test_sqlite_row_as_tuple(self): | |
| 186 | 192 | """Checks if the row object can be converted to a tuple""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments