def test_table_with_index(self): task = self.create_task(cls=InsertIntoMysqlDummyTableWithIndexes) connection = MagicMock() task.create_table(connection) connection.cursor.return_value.execute.assert_called_once_with( "CREATE TABLE IF NOT EXISTS dummy_table " "(id BIGINT(20) NOT NULL AUTO_INCREMENT,course_id VARCHAR(255)," "interval_start DATETIME,interval_end DATETIME,label VARCHAR(255)," "count INT,created TIMESTAMP DEFAULT NOW(),PRIMARY KEY (id)," "INDEX (course_id),INDEX (interval_start,interval_end))")
def test_table_with_index(self): task = self.create_task(cls=InsertIntoMysqlDummyTableWithIndexes) connection = MagicMock() task.create_table(connection) connection.cursor.return_value.execute.assert_called_once_with( "CREATE TABLE IF NOT EXISTS dummy_table " "(id BIGINT(20) NOT NULL AUTO_INCREMENT,course_id VARCHAR(255)," "interval_start DATETIME,interval_end DATETIME,label VARCHAR(255)," "count INT,created TIMESTAMP DEFAULT NOW(),PRIMARY KEY (id)," "INDEX (course_id),INDEX (interval_start,interval_end))" )
def test_create_table_without_table_definition(self): connection = MagicMock() task = self.create_task(cls=VerticaCopyTask) with self.assertRaises(NotImplementedError): task.create_table(connection)
def test_create_table_without_column_definition(self): connection = MagicMock() task = self.create_task(cls=CopyToPredefinedVerticaDummyTable) with self.assertRaises(NotImplementedError): task.create_table(connection)