/usr/lib/python2.7/dist-packages/migrate/tests/changeset/databases/test_ibmdb2.py is in python-migrate 0.10.0-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
import six
import testtools
try:
from migrate.changeset.databases import ibmdb2
except ImportError:
ibmdb2 = None
from migrate.tests import fixture
@testtools.skipIf(not ibmdb2, "Skipping IBM DB2 tests")
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)
|