Fix mock for v2 test
In 7eec2c5d
we removed the _VERSIONS constant from the api discovery
module. By a quirk of the way the unit tests are ordered, the mock to
patch this constant continued to work if the whole test suite was run,
but it doesn't work if we just run that test alone or the test_versions
suite alone. This patch cleans up the unneeded mock.
Change-Id: If88db5b8f4cb3425fd7a568213aa094fe7800c38
This commit is contained in:
parent
458d5e6df9
commit
431e5a81b3
@ -859,8 +859,6 @@ class TestCase(BaseTestCase):
|
||||
self.addCleanup(notifications.clear_subscribers)
|
||||
self.addCleanup(notifications.reset_notifier)
|
||||
|
||||
self.addCleanup(setattr, keystone.api.discovery, '_VERSIONS', [])
|
||||
|
||||
def config(self, config_files):
|
||||
sql.initialize()
|
||||
CONF(args=[], project='keystone', default_config_files=config_files)
|
||||
|
@ -17,7 +17,6 @@ import copy
|
||||
import functools
|
||||
import random
|
||||
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from six.moves import http_client
|
||||
from testtools import matchers as tt_matchers
|
||||
@ -761,7 +760,6 @@ class VersionTestCase(unit.TestCase):
|
||||
self._paste_in_port(expected['version'], 'http://localhost/v3/')
|
||||
self.assertEqual(expected, data)
|
||||
|
||||
@mock.patch.object(discovery, '_VERSIONS', ['v3'])
|
||||
def test_v2_disabled(self):
|
||||
# NOTE(morgan): This test should be kept, v2.0 is removed and should
|
||||
# never return, this prevents regression[s]/v2.0 discovery doc
|
||||
|
Loading…
Reference in New Issue
Block a user