Fix multiple gate issues
- Remove B322 bandit from exclusions - Fix tests for db resource update exposed by SQLAlchemy>=1.3.21 Change-Id: I18efbbbe211a42325a946f5ca74b4e26bfb3316e
This commit is contained in:
parent
7e12f69845
commit
f4ab9d0bc0
@ -3110,7 +3110,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, None)
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual('CREATE', db_res.action)
|
||||
self.assertEqual('IN_PROGRESS', db_res.status)
|
||||
@ -3124,7 +3124,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, None)
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual(1, db_res.atomic_key)
|
||||
values = {'engine_id': 'engine-1',
|
||||
@ -3133,7 +3133,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, 'engine-1')
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual('CREATE', db_res.action)
|
||||
self.assertEqual('FAILED', db_res.status)
|
||||
@ -3147,7 +3147,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, None)
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual(1, db_res.atomic_key)
|
||||
values = {'engine_id': 'engine-2',
|
||||
@ -3165,7 +3165,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, None)
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual(1, db_res.atomic_key)
|
||||
# Set engine id as None to release the lock
|
||||
@ -3175,7 +3175,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, 'engine-1')
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertIsNone(db_res.engine_id)
|
||||
self.assertEqual('CREATE', db_res.action)
|
||||
self.assertEqual('COMPLETE', db_res.status)
|
||||
@ -3189,7 +3189,8 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, None)
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-1', db_res.engine_id)
|
||||
self.assertEqual(1, db_res.atomic_key)
|
||||
# Set engine id as engine-2 and pass expected engine id as old engine
|
||||
@ -3200,7 +3201,7 @@ class DBAPIResourceUpdateTest(common.HeatTestCase):
|
||||
ret = db_api.resource_update(self.ctx, self.resource.id,
|
||||
values, db_res.atomic_key, 'engine-1')
|
||||
self.assertTrue(ret)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id)
|
||||
db_res = db_api.resource_get(self.ctx, self.resource.id, refresh=True)
|
||||
self.assertEqual('engine-2', db_res.engine_id)
|
||||
self.assertEqual('DELETE', db_res.action)
|
||||
self.assertEqual(2, db_res.atomic_key)
|
||||
|
3
tox.ini
3
tox.ini
@ -30,14 +30,13 @@ commands =
|
||||
# B110: Try, Except, Pass detected.
|
||||
# B310: Audit url open for permitted schemes
|
||||
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purposes
|
||||
# B322: The input method is safe in Python 3.
|
||||
# B404: Import of subprocess module
|
||||
# B410: Import of lxml module
|
||||
# B504: Test for SSL use with no version specified
|
||||
# B506: Test for use of yaml load
|
||||
# B603: Test for use of subprocess with shell equals true
|
||||
# B607: Test for starting a process with a partial path
|
||||
bandit -r heat -x tests --skip B101,B104,B107,B110,B310,B311,B322,B404,B410,B504,B506,B603,B607
|
||||
bandit -r heat -x tests --skip B101,B104,B107,B110,B310,B311,B404,B410,B504,B506,B603,B607
|
||||
doc8 {posargs}
|
||||
|
||||
[testenv:venv]
|
||||
|
Loading…
Reference in New Issue
Block a user