-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: foreign key on delete cascade action testing and samples #910
Changes from all commits
7b7cca9
069056a
bab2faa
1b4dd42
51e21e9
b4b7e6e
e33e7d9
c06d3b6
31d63c3
f1c2e3c
9487290
3b590e4
a7bbcc5
ce31137
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -794,3 +794,25 @@ def test_list_database_roles(capsys, instance_id, sample_database): | |
snippets.list_database_roles(instance_id, sample_database.database_id) | ||
out, _ = capsys.readouterr() | ||
assert "new_parent" in out | ||
|
||
|
||
@pytest.mark.dependency(name="create_table_with_foreign_key_delete_cascade") | ||
def test_create_table_with_foreign_key_delete_cascade(capsys, instance_id, sample_database): | ||
snippets.create_table_with_foreign_key_delete_cascade(instance_id, sample_database.database_id) | ||
out, _ = capsys.readouterr() | ||
assert "Created Customers and ShoppingCarts table with FKShoppingCartsCustomerId" in out | ||
|
||
|
||
@pytest.mark.dependency(name="alter_table_with_foreign_key_delete_cascade", | ||
depends=["create_table_with_foreign_key_delete_cascade"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, As we are adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is common in samples to have this dependency to reduce the time to run these |
||
def test_alter_table_with_foreign_key_delete_cascade(capsys, instance_id, sample_database): | ||
snippets.alter_table_with_foreign_key_delete_cascade(instance_id, sample_database.database_id) | ||
out, _ = capsys.readouterr() | ||
assert "Altered ShoppingCarts table with FKShoppingCartsCustomerName" in out | ||
|
||
|
||
@pytest.mark.dependency(depends=["alter_table_with_foreign_key_delete_cascade"]) | ||
def test_drop_foreign_key_contraint_delete_cascade(capsys, instance_id, sample_database): | ||
snippets.drop_foreign_key_constraint_delete_cascade(instance_id, sample_database.database_id) | ||
out, _ = capsys.readouterr() | ||
assert "Altered ShoppingCarts table to drop FKShoppingCartsCustomerName" in out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be instead of checking the output message we should verify that the table was actually created/ altered by the sample or not ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For IT, yes but for samples we just need the to check if an error is not thrown