Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit c40c1da

Browse files
committed
[PYTHON-244] Update docs for test
1 parent 427dfd9 commit c40c1da

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

tests/integration/cqlengine/model/test_model.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,42 @@ class EqualityModel1(Model):
5151
self.assertNotEqual(m0, m1)
5252

5353
def test_keywords_as_names(self):
54+
"""
55+
Test for CQL keywords as names
56+
57+
test_keywords_as_names tests that CQL keywords are properly and automatically quoted in cqlengine. It creates
58+
a keyspace, keyspace, which should be automatically quoted to "keyspace" in CQL. It then creates a table, table,
59+
which should also be automatically quoted to "table". It then verfies that operations can be done on the
60+
"keyspace"."table" which has been created. It also verifies that table alternations work and operations can be
61+
performed on the altered table.
62+
63+
@since 2.6.0
64+
@jira_ticket PYTHON-244
65+
@expected_result Cqlengine should quote CQL keywords properly when creating keyspaces and tables.
66+
67+
@test_category schema:generation
68+
"""
69+
70+
# If the keyspace exists, it will not be re-created
5471
create_keyspace_simple('keyspace', 1)
5572

5673
class table(Model):
5774
__keyspace__ = 'keyspace'
5875
select = columns.Integer(primary_key=True)
5976
table = columns.Text()
6077

61-
# create should work
78+
# In case the table already exists in keyspace
6279
drop_table(table)
80+
81+
# Create should work
6382
sync_table(table)
6483

6584
created = table.create(select=0, table='table')
6685
selected = table.objects(select=0)[0]
6786
self.assertEqual(created.select, selected.select)
6887
self.assertEqual(created.table, selected.table)
6988

70-
# alter should work
89+
# Alter should work
7190
class table(Model):
7291
__keyspace__ = 'keyspace'
7392
select = columns.Integer(primary_key=True)

0 commit comments

Comments
 (0)