py34: heat.tests.db.*

partial blueprint heat-python34-support

Change-Id: I14330260f85f0a89fb655908dd47f07891f0af78
This commit is contained in:
Sirushti Murugesan 2015-07-31 23:56:44 +05:30
parent 2060ef1f5c
commit e2901944d6
4 changed files with 6 additions and 3 deletions

View File

@ -40,7 +40,7 @@ def encrypt(value, encryption_key=None):
encoded_key = base64.b64encode(encryption_key.encode('utf-8'))
sym = fernet.Fernet(encoded_key)
res = sym.encrypt(encodeutils.safe_encode(value))
return 'cryptography_decrypt_v1', res
return 'cryptography_decrypt_v1', encodeutils.safe_decode(res)
def decrypt(method, data, encryption_key=None):

View File

@ -31,6 +31,7 @@ from oslo_db.sqlalchemy import utils
from oslo_serialization import jsonutils
import six
import sqlalchemy
import testtools
from heat.db.sqlalchemy import migrate_repo
from heat.db.sqlalchemy import migration
@ -59,13 +60,14 @@ class HeatMigrationsCheckers(test_migrations.WalkVersionsMixin,
@property
def migration_api(self):
temp = __import__('oslo_db.sqlalchemy.migration', globals(),
locals(), ['versioning_api'], -1)
locals(), ['versioning_api'], 0)
return temp.versioning_api
@property
def migrate_engine(self):
return self.engine
@testtools.skipIf(six.PY3, "skip until a new release of oslo.db is cut")
def test_walk_versions(self):
self.walk_versions(self.snake_walk, self.downgrade)

View File

@ -1942,7 +1942,6 @@ class StackTest(common.HeatTestCase):
self.assertEqual('foo', params['param1'])
self.assertEqual('bar', params['param2'])
@testtools.skipIf(six.PY3, "needs a separate change")
def test_parameters_stored_encrypted_decrypted_on_load(self):
'''
Test stack loading with disabled parameter value validation.

View File

@ -32,6 +32,8 @@ heat.tests.clients.test_mistral_client
heat.tests.clients.test_neutron_client
heat.tests.clients.test_sahara_client
heat.tests.clients.test_zaqar_client
heat.tests.db.test_migrations
heat.tests.db.test_sqlalchemy_api
heat.tests.db.test_sqlalchemy_filters
heat.tests.db.test_sqlalchemy_types
heat.tests.db.test_utils