Fix boolean types in db migration tests

In gate py27 and py35 unit tests are failing on
alembic migration tests with exceptions like this [1].
Apparently sqlAlchemy 1.2.1 enforces type checks for
database fields that 1.1.15 just coerced.

Change strings to booleans and ints in the test
code so that fields in the "fakes" match the
fields in the sqlalchemy models.

Co-Authored-By: Tom Barron <tpb@dyncloud.net>

[1] http://logs.openstack.org/68/539468/1/check/openstack-tox-py27/db4a572/job-output.txt.gz#_2018-01-31_09_26_49_316004

Change-Id: Iadffb8a06b4d948d77fc00b85118e538b0a19b24
This commit is contained in:
zhongjun 2018-01-31 17:05:53 +08:00 committed by Tom Barron
parent a07d522970
commit 95de4d2134
1 changed files with 6 additions and 6 deletions

View File

@ -130,13 +130,13 @@ def fake_share(**kwargs):
'display_description': 'my fake share',
'snapshot_id': uuidutils.generate_uuid(),
'share_proto': 'nfs',
'is_public': '1',
'size': '1',
'is_public': True,
'size': 1,
'deleted': 'False',
'share_proto': 'fake_proto',
'user_id': uuidutils.generate_uuid(),
'project_id': uuidutils.generate_uuid(),
'snapshot_support': '1',
'snapshot_support': True,
'task_state': None,
}
share.update(kwargs)
@ -375,7 +375,7 @@ class AvailabilityZoneMigrationChecks(BaseMigrationChecks):
base_dict = {
'binary': 'manila-share',
'topic': 'share',
'disabled': '0',
'disabled': False,
'report_count': '100',
}
base_dict.update(options)
@ -1322,7 +1322,7 @@ class CreateFromSnapshotExtraSpecAndShareColumn(BaseMigrationChecks):
'is_public': True,
},
]
snapshot_support = ('0', '1')
snapshot_support = (False, True)
dhss = ('True', 'False')
for idx, share_type in enumerate(share_types):
extra_specs.append({
@ -1476,7 +1476,7 @@ class RevertToSnapshotShareColumn(BaseMigrationChecks):
},
]
snapshot_support = ('0', '1')
snapshot_support = (False, True)
dhss = ('True', 'False')
for idx, share_type in enumerate(share_types):
extra_specs.append({