From 40563e9355f4dd2e677d65b37a2e40dfb0f8ff31 Mon Sep 17 00:00:00 2001 From: donkopotamus Date: Tue, 14 Jan 2014 12:44:05 +1300 Subject: Support mssql_clustered option in mssql dialect for both Table and PrimaryKeyConstraint --- test/dialect/mssql/test_compiler.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index 1742f024c..40ca603a0 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -510,6 +510,28 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "CREATE TABLE test (id INTEGER NOT NULL IDENTITY(1,1))" ) + def test_table_pkc_clustering_1(self): + metadata = MetaData() + tbl = Table('test', metadata, + Column('x', Integer, primary_key=True, autoincrement=False), + Column('y', Integer, primary_key=True, autoincrement=False), + mssql_clustered=True) + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE test (x INTEGER NOT NULL, y INTEGER NOT NULL, " + "PRIMARY KEY CLUSTERED (x, y))" + ) + + def test_table_pkc_clustering_2(self): + metadata = MetaData() + tbl = Table('test', metadata, + Column('x', Integer, autoincrement=False), + Column('y', Integer, autoincrement=False), + PrimaryKeyConstraint("x", "y", mssql_clustered=True)) + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE test (x INTEGER NOT NULL, y INTEGER NOT NULL, " + "PRIMARY KEY CLUSTERED (x, y))" + ) + def test_index_clustering(self): metadata = MetaData() tbl = Table('test', metadata, -- cgit v1.2.1