MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_dump_autoincrement

Method test_dump_autoincrement

Lib/test/test_sqlite3/test_dump.py:132–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

130
131 @unittest.expectedFailure # TODO: RUSTPYTHON _iterdump not implemented
132 def test_dump_autoincrement(self):
133 expected = [
134 'CREATE TABLE "t1" (id integer primary key autoincrement);',
135 'INSERT INTO "t1" VALUES(NULL);',
136 'CREATE TABLE "t2" (id integer primary key autoincrement);',
137 ]
138 self.cu.executescript("".join(expected))
139
140 # the NULL value should now be automatically be set to 1
141 expected[1] = expected[1].replace("NULL", "1")
142 expected.insert(0, "BEGIN TRANSACTION;")
143 expected.extend([
144 'DELETE FROM "sqlite_sequence";',
145 'INSERT INTO "sqlite_sequence" VALUES(\'t1\',1);',
146 'COMMIT;',
147 ])
148
149 actual = [stmt for stmt in self.cx.iterdump()]
150 self.assertEqual(expected, actual)
151
152 @unittest.expectedFailure # TODO: RUSTPYTHON _iterdump not implemented
153 def test_dump_autoincrement_create_new_db(self):

Callers

nothing calls this directly

Calls 7

executescriptMethod · 0.80
iterdumpMethod · 0.80
joinMethod · 0.45
replaceMethod · 0.45
insertMethod · 0.45
extendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected