sqlalchemy-migrate/migrate/tests/changeset/databases/test_ibmdb2.py
Matt Riedemann 85317aead6 Add DB2 10.5 Support
This patch adds the initial support for DB2 10.5 to migrate. It
includes:

1. The dialect implementation for DB2.
2. The dialect registration with the visitor.
3. Code to parse the engine name in version.py.
4. A new dependency on ibm_db_sa in test-requirements.txt.
5. A connection string in test_db.cfg for ibm_db_sa.

Part of blueprint add-db2-support

Co-authored-by: Sheng Bo Hou <sbhou@cn.ibm.com>
Co-authored-by: Thuy Christenson <thuy@us.ibm.com>
Co-authored-by: Rahul Priyadarshi <rahul.priyadarshi@in.ibm.com>
Change-Id: I745ec615487b1b06c5d1a09ea316f376d66ee4c0
2014-02-17 07:17:31 -08:00

33 lines
902 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
import six
from migrate.changeset.databases import ibmdb2
from migrate.tests import fixture
class TestIBMDBDialect(fixture.Base):
"""
Test class for ibmdb2 dialect unit tests which do not require
a live backend database connection.
"""
def test_is_unique_constraint_with_null_cols_supported(self):
test_values = {
'10.1': False,
'10.4.99': False,
'10.5': True,
'10.5.1': True
}
for version, supported in six.iteritems(test_values):
mock_dialect = mock.MagicMock()
mock_dialect.dbms_ver = version
self.assertEqual(
supported,
ibmdb2.is_unique_constraint_with_null_columns_supported(
mock_dialect),
'Assertion failed on version: %s' % version)