mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
modified tests as we do not have rollback yet. Also correctly raise a contraint error on primary keys only
This commit is contained in:
parent
3aaf4206b7
commit
758dfff2fe
2 changed files with 113 additions and 21 deletions
|
@ -304,9 +304,8 @@ def generate_test(col_amount: int, primary_keys: int) -> ConstraintTest:
|
|||
|
||||
update_errors = []
|
||||
if len(insert_stmts) > 1:
|
||||
update_errors = [
|
||||
table.generate_update() for _ in table.columns if col.primary_key
|
||||
]
|
||||
# TODO: As we have no rollback we just generate one update statement
|
||||
update_errors = [table.generate_update()]
|
||||
|
||||
return ConstraintTest(
|
||||
table=table,
|
||||
|
@ -327,7 +326,6 @@ def custom_test_1() -> ConstraintTest:
|
|||
"INSERT INTO users VALUES (2, 'bob');",
|
||||
]
|
||||
update_stmts = [
|
||||
"UPDATE users SET id = 3;",
|
||||
"UPDATE users SET id = 2, username = 'bob' WHERE id == 1;",
|
||||
]
|
||||
return ConstraintTest(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue