Merge "Fix disallowed-name warnings"

This commit is contained in:
Zuul
2024-03-22 01:27:40 +00:00
committed by Gerrit Code Review
3 changed files with 9 additions and 9 deletions

View File

@@ -784,7 +784,7 @@ class PluginAwareExtensionManagerTest(base.BaseTestCase):
"""Implements get_foo method as expected by extension."""
supported_extension_aliases = ["supported_extension"]
def get_foo(self, bar=None):
def get_foo(self, ext=None):
pass
def get_plugin_type(self):

View File

@@ -22,13 +22,13 @@ from neutron.tests import base
@mock.patch.object(lockutils, 'lock')
class CoordinationTestCase(base.BaseTestCase):
def test_synchronized(self, get_lock):
@coordination.synchronized('lock-{f_name}-{foo.val}-{bar[val]}')
def func(foo, bar):
@coordination.synchronized('lock-{f_name}-{arg1.val}-{arg2[val]}')
def func(arg1, arg2):
pass
foo = mock.Mock()
foo.val = 7
bar = mock.MagicMock()
bar.__getitem__.return_value = 8
func(foo, bar)
arg1 = mock.Mock()
arg1.val = 7
arg2 = mock.MagicMock()
arg2.__getitem__.return_value = 8
func(arg1, arg2)
get_lock.assert_called_with('lock-func-7-8')

View File

@@ -70,7 +70,7 @@ class ExtensionExpectingPluginInterface(StubExtension):
class StubPluginInterface(base.ServicePluginBase):
@abc.abstractmethod
def get_foo(self, bar=None):
def get_foo(self, ext=None):
pass
def get_plugin_type(self):