mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 02:14:31 +02:00
parent
bf1ac778a3
commit
fb93452ea8
20 changed files with 910 additions and 849 deletions
|
|
@ -167,13 +167,13 @@ def test_memory_dump(extra_args):
|
|||
expected = (
|
||||
"BEGIN TRANSACTION;\n"
|
||||
'CREATE TABLE IF NOT EXISTS "stdin" (\n'
|
||||
" [id] INTEGER,\n"
|
||||
" [name] TEXT\n"
|
||||
' "id" INTEGER,\n'
|
||||
' "name" TEXT\n'
|
||||
");\n"
|
||||
"INSERT INTO \"stdin\" VALUES(1,'Cleo');\n"
|
||||
"INSERT INTO \"stdin\" VALUES(2,'Bants');\n"
|
||||
"CREATE VIEW t1 AS select * from [stdin];\n"
|
||||
"CREATE VIEW t AS select * from [stdin];\n"
|
||||
'CREATE VIEW "t1" AS select * from "stdin";\n'
|
||||
'CREATE VIEW "t" AS select * from "stdin";\n'
|
||||
"COMMIT;"
|
||||
)
|
||||
# Using sqlite-dump it won't have IF NOT EXISTS
|
||||
|
|
@ -191,11 +191,11 @@ def test_memory_schema(extra_args):
|
|||
assert result.exit_code == 0
|
||||
assert result.output.strip() == (
|
||||
'CREATE TABLE "stdin" (\n'
|
||||
" [id] INTEGER,\n"
|
||||
" [name] TEXT\n"
|
||||
' "id" INTEGER,\n'
|
||||
' "name" TEXT\n'
|
||||
");\n"
|
||||
"CREATE VIEW t1 AS select * from [stdin];\n"
|
||||
"CREATE VIEW t AS select * from [stdin];"
|
||||
'CREATE VIEW "t1" AS select * from "stdin";\n'
|
||||
'CREATE VIEW "t" AS select * from "stdin";'
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -285,16 +285,16 @@ def test_memory_two_files_with_same_stem(tmpdir):
|
|||
assert result.exit_code == 0
|
||||
assert result.output == (
|
||||
'CREATE TABLE "data" (\n'
|
||||
" [id] INTEGER,\n"
|
||||
" [name] TEXT\n"
|
||||
' "id" INTEGER,\n'
|
||||
' "name" TEXT\n'
|
||||
");\n"
|
||||
"CREATE VIEW t1 AS select * from [data];\n"
|
||||
"CREATE VIEW t AS select * from [data];\n"
|
||||
'CREATE VIEW "t1" AS select * from "data";\n'
|
||||
'CREATE VIEW "t" AS select * from "data";\n'
|
||||
'CREATE TABLE "data_2" (\n'
|
||||
" [id] INTEGER,\n"
|
||||
" [name] TEXT\n"
|
||||
' "id" INTEGER,\n'
|
||||
' "name" TEXT\n'
|
||||
");\n"
|
||||
"CREATE VIEW t2 AS select * from [data_2];\n"
|
||||
'CREATE VIEW "t2" AS select * from "data_2";\n'
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue