Skip to content

Commit 0d8dcf8

Browse files
committed
Tests: Improve test case about verifying words to be quoted
1 parent a5e749c commit 0d8dcf8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/compiler_test.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ class FooBar(Base):
433433
self.assertIn("CrateDB does not support unique constraints, "
434434
"they will be omitted when generating DDL statements.", str(w[-1].message))
435435

436-
def test_ddl_with_reserved_words(self):
436+
def test_ddl_with_reserved_words_and_uppercase(self):
437437
"""
438-
Verify CrateDB's reserved words like `object` are quoted properly.
438+
Verify CrateDB's reserved words and columns using uppercase characters are quoted properly.
439439
"""
440440

441441
Base = declarative_base(metadata=self.metadata)
@@ -445,18 +445,20 @@ class FooBar(Base):
445445

446446
__tablename__ = "foobar"
447447

448-
index = sa.Column(sa.Integer, primary_key=True)
448+
ID = sa.Column(sa.Integer, primary_key=True)
449+
index = sa.Column(sa.Integer)
449450
array = sa.Column(sa.String)
450451
object = sa.Column(sa.String)
451452

452453
# Verify SQL DDL statement.
453454
self.metadata.create_all(self.engine, tables=[FooBar.__table__], checkfirst=False)
454455
self.assertEqual(self.executed_statement, dedent("""
455456
CREATE TABLE testdrive.foobar (
456-
\t"index" INT NOT NULL,
457+
\t"ID" INT NOT NULL,
458+
\t"index" INT,
457459
\t"array" STRING,
458460
\t"object" STRING,
459-
\tPRIMARY KEY ("index")
461+
\tPRIMARY KEY ("ID")
460462
)
461463
462464
""")) # noqa: W291, W293

0 commit comments

Comments
 (0)