summaryrefslogtreecommitdiff
path: root/tests/test_op.py
diff options
context:
space:
mode:
authorMike Waites <mikey.waites@gmail.com>2018-08-31 19:56:36 +0100
committermike bayer <mike_mp@zzzcomputing.com>2019-01-10 02:09:03 +0000
commitec8db7d875f486cde2d02942bd8409abf37e3704 (patch)
tree3760cd8551f84dcd91a04cf4b4b60c589b7e2ad0 /tests/test_op.py
parent1cf6fc014570cf0bdc7ea2a7d5f36f2dda5f61b7 (diff)
downloadalembic-ec8db7d875f486cde2d02942bd8409abf37e3704.tar.gz
Implemented support for Table and Column Comments
Added Table and Column level comments for supported backends. `create_table`, `add_column` and `alter_column` now optionally take `comment="X"` kwarg. Support for autogenerate for Table and Column objects has also been added Fixes: #422 Change-Id: I1fd37bb7fe3d167baf7b1e7bf7ff5bfd48e7cf54
Diffstat (limited to 'tests/test_op.py')
-rw-r--r--tests/test_op.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_op.py b/tests/test_op.py
index ce0686c..8a3e32f 100644
--- a/tests/test_op.py
+++ b/tests/test_op.py
@@ -896,6 +896,22 @@ class OpTest(TestBase):
op.drop_index("ik_test", tablename="t1")
context.assert_("DROP INDEX ik_test ON t1")
+ @config.requirements.comments
+ def test_create_table_comment_op(self):
+ context = op_fixture()
+
+ op.create_table_comment("some_table", "table comment")
+
+ context.assert_("COMMENT ON TABLE some_table IS 'table comment'")
+
+ @config.requirements.comments
+ def test_drop_table_comment_op(self):
+ context = op_fixture()
+
+ op.drop_table_comment("some_table")
+
+ context.assert_("COMMENT ON TABLE some_table IS NULL")
+
class SQLModeOpTest(TestBase):
def test_auto_literals(self):