Fix SqlAlchemy >1.3.19 support

SQLAlchemy 1.3.19 change the excepted exception and 1.4.x
changed the enum checking behavior such that we were no
longer raising an exception matching the check.

While we had a test for this, We didn't actually
check for it anywhere in the code. And the states are
driven by the code, so the underlying test that was broken
felt redundant. As such, it has been removed.

Change-Id: I39fa3d85978555b6cb9d0884a90625b4765bac28
This commit is contained in:
Julia Kreger 2021-06-15 12:47:33 -07:00
parent 1ba0849b6b
commit 948325cae7

View File

@ -20,7 +20,6 @@ from unittest import mock
import automaton
from oslo_config import cfg
import oslo_db
from oslo_utils import timeutils
from oslo_utils import uuidutils
@ -1042,11 +1041,6 @@ class TestNodeInfoState(test_base.NodeStateTest):
row = db.model_query(db.Node).get(self.node_info.uuid)
self.assertEqual(self.node_info.state, row.state)
def test_set_invalid_state(self):
self.assertRaisesRegex(oslo_db.exception.DBError,
'constraint failed',
self.node_info._set_state, 'foo')
def test_commit(self):
current_time = timeutils.utcnow()
self.node_info.started_at = self.node_info.finished_at = current_time