Fixed a bunch of spacing
Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
This commit is contained in:
parent
c949802f9a
commit
b1ee642b43
@ -37,6 +37,7 @@ USER_AGENT = 'python-openstackclient'
|
|||||||
|
|
||||||
class ClientCache(object):
|
class ClientCache(object):
|
||||||
"""Descriptor class for caching created client handles."""
|
"""Descriptor class for caching created client handles."""
|
||||||
|
|
||||||
def __init__(self, factory):
|
def __init__(self, factory):
|
||||||
self.factory = factory
|
self.factory = factory
|
||||||
self._handle = None
|
self._handle = None
|
||||||
|
@ -22,6 +22,7 @@ import six
|
|||||||
|
|
||||||
|
|
||||||
class CommandMeta(abc.ABCMeta):
|
class CommandMeta(abc.ABCMeta):
|
||||||
|
|
||||||
def __new__(mcs, name, bases, cls_dict):
|
def __new__(mcs, name, bases, cls_dict):
|
||||||
if 'log' not in cls_dict:
|
if 'log' not in cls_dict:
|
||||||
cls_dict['log'] = logging.getLogger(
|
cls_dict['log'] = logging.getLogger(
|
||||||
|
@ -41,6 +41,7 @@ class UnsupportedVersion(Exception):
|
|||||||
|
|
||||||
class ClientException(Exception):
|
class ClientException(Exception):
|
||||||
"""The base exception class for all exceptions this library raises."""
|
"""The base exception class for all exceptions this library raises."""
|
||||||
|
|
||||||
def __init__(self, code, message=None, details=None):
|
def __init__(self, code, message=None, details=None):
|
||||||
self.code = code
|
self.code = code
|
||||||
self.message = message or self.__class__.message
|
self.message = message or self.__class__.message
|
||||||
|
@ -47,6 +47,7 @@ class Container(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeOptions(object):
|
class FakeOptions(object):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
for option in auth.OPTIONS_LIST:
|
for option in auth.OPTIONS_LIST:
|
||||||
setattr(self, option.replace('-', '_'), None)
|
setattr(self, option.replace('-', '_'), None)
|
||||||
@ -71,6 +72,7 @@ class TestClientCache(utils.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class TestClientManager(utils.TestCase):
|
class TestClientManager(utils.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestClientManager, self).setUp()
|
super(TestClientManager, self).setUp()
|
||||||
self.mock = mock.Mock()
|
self.mock = mock.Mock()
|
||||||
|
@ -19,6 +19,7 @@ from openstackclient.tests import utils as test_utils
|
|||||||
|
|
||||||
|
|
||||||
class FakeCommand(command.Command):
|
class FakeCommand(command.Command):
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ from openstackclient.tests import utils
|
|||||||
|
|
||||||
|
|
||||||
class FakeCommand(object):
|
class FakeCommand(object):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
return cls
|
return cls
|
||||||
@ -48,6 +49,7 @@ class FakeCommandManager(commandmanager.CommandManager):
|
|||||||
|
|
||||||
|
|
||||||
class TestCommandManager(utils.TestCase):
|
class TestCommandManager(utils.TestCase):
|
||||||
|
|
||||||
def test_add_command_group(self):
|
def test_add_command_group(self):
|
||||||
mgr = FakeCommandManager('test')
|
mgr = FakeCommandManager('test')
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ class TestContext(utils.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class TestFileFormatter(utils.TestCase):
|
class TestFileFormatter(utils.TestCase):
|
||||||
|
|
||||||
def test_nothing(self):
|
def test_nothing(self):
|
||||||
formatter = logs._FileFormatter()
|
formatter = logs._FileFormatter()
|
||||||
self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
|
self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
|
||||||
@ -93,6 +94,7 @@ class TestFileFormatter(utils.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class TestLogConfigurator(utils.TestCase):
|
class TestLogConfigurator(utils.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestLogConfigurator, self).setUp()
|
super(TestLogConfigurator, self).setUp()
|
||||||
self.options = mock.Mock()
|
self.options = mock.Mock()
|
||||||
|
@ -250,6 +250,7 @@ class NoUniqueMatch(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class TestFindResource(test_utils.TestCase):
|
class TestFindResource(test_utils.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestFindResource, self).setUp()
|
super(TestFindResource, self).setUp()
|
||||||
self.name = 'legos'
|
self.name = 'legos'
|
||||||
|
@ -51,6 +51,7 @@ TEST_VERSIONS = fixture.DiscoveryList(href=AUTH_URL)
|
|||||||
|
|
||||||
|
|
||||||
class FakeStdout(object):
|
class FakeStdout(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.content = []
|
self.content = []
|
||||||
|
|
||||||
@ -65,6 +66,7 @@ class FakeStdout(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeLog(object):
|
class FakeLog(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.messages = {}
|
self.messages = {}
|
||||||
|
|
||||||
@ -85,6 +87,7 @@ class FakeLog(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeApp(object):
|
class FakeApp(object):
|
||||||
|
|
||||||
def __init__(self, _stdout, _log):
|
def __init__(self, _stdout, _log):
|
||||||
self.stdout = _stdout
|
self.stdout = _stdout
|
||||||
self.client_manager = None
|
self.client_manager = None
|
||||||
@ -95,12 +98,14 @@ class FakeApp(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeClient(object):
|
class FakeClient(object):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.endpoint = kwargs['endpoint']
|
self.endpoint = kwargs['endpoint']
|
||||||
self.token = kwargs['token']
|
self.token = kwargs['token']
|
||||||
|
|
||||||
|
|
||||||
class FakeClientManager(object):
|
class FakeClientManager(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.compute = None
|
self.compute = None
|
||||||
self.identity = None
|
self.identity = None
|
||||||
@ -129,12 +134,14 @@ class FakeClientManager(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeModule(object):
|
class FakeModule(object):
|
||||||
|
|
||||||
def __init__(self, name, version):
|
def __init__(self, name, version):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.__version__ = version
|
self.__version__ = version
|
||||||
|
|
||||||
|
|
||||||
class FakeResource(object):
|
class FakeResource(object):
|
||||||
|
|
||||||
def __init__(self, manager=None, info={}, loaded=False, methods={}):
|
def __init__(self, manager=None, info={}, loaded=False, methods={}):
|
||||||
"""Set attributes and methods for a resource.
|
"""Set attributes and methods for a resource.
|
||||||
|
|
||||||
@ -178,6 +185,7 @@ class FakeResource(object):
|
|||||||
|
|
||||||
|
|
||||||
class FakeResponse(requests.Response):
|
class FakeResponse(requests.Response):
|
||||||
|
|
||||||
def __init__(self, headers={}, status_code=200, data=None, encoding=None):
|
def __init__(self, headers={}, status_code=200, data=None, encoding=None):
|
||||||
super(FakeResponse, self).__init__()
|
super(FakeResponse, self).__init__()
|
||||||
|
|
||||||
@ -190,6 +198,7 @@ class FakeResponse(requests.Response):
|
|||||||
|
|
||||||
|
|
||||||
class FakeModel(dict):
|
class FakeModel(dict):
|
||||||
|
|
||||||
def __getattr__(self, key):
|
def __getattr__(self, key):
|
||||||
try:
|
try:
|
||||||
return self[key]
|
return self[key]
|
||||||
|
@ -161,6 +161,7 @@ def fake_execute(shell, cmd):
|
|||||||
|
|
||||||
|
|
||||||
class TestShell(utils.TestCase):
|
class TestShell(utils.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShell, self).setUp()
|
super(TestShell, self).setUp()
|
||||||
patch = "openstackclient.shell.OpenStackShell.run_subcommand"
|
patch = "openstackclient.shell.OpenStackShell.run_subcommand"
|
||||||
@ -280,6 +281,7 @@ class TestShell(utils.TestCase):
|
|||||||
|
|
||||||
class TestShellHelp(TestShell):
|
class TestShellHelp(TestShell):
|
||||||
"""Test the deferred help flag"""
|
"""Test the deferred help flag"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellHelp, self).setUp()
|
super(TestShellHelp, self).setUp()
|
||||||
self.orig_env, os.environ = os.environ, {}
|
self.orig_env, os.environ = os.environ, {}
|
||||||
@ -304,6 +306,7 @@ class TestShellHelp(TestShell):
|
|||||||
|
|
||||||
|
|
||||||
class TestShellOptions(TestShell):
|
class TestShellOptions(TestShell):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellOptions, self).setUp()
|
super(TestShellOptions, self).setUp()
|
||||||
self.orig_env, os.environ = os.environ, {}
|
self.orig_env, os.environ = os.environ, {}
|
||||||
@ -391,6 +394,7 @@ class TestShellOptions(TestShell):
|
|||||||
|
|
||||||
|
|
||||||
class TestShellTokenAuthEnv(TestShell):
|
class TestShellTokenAuthEnv(TestShell):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellTokenAuthEnv, self).setUp()
|
super(TestShellTokenAuthEnv, self).setUp()
|
||||||
env = {
|
env = {
|
||||||
@ -438,6 +442,7 @@ class TestShellTokenAuthEnv(TestShell):
|
|||||||
|
|
||||||
|
|
||||||
class TestShellTokenEndpointAuthEnv(TestShell):
|
class TestShellTokenEndpointAuthEnv(TestShell):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellTokenEndpointAuthEnv, self).setUp()
|
super(TestShellTokenEndpointAuthEnv, self).setUp()
|
||||||
env = {
|
env = {
|
||||||
@ -485,6 +490,7 @@ class TestShellTokenEndpointAuthEnv(TestShell):
|
|||||||
|
|
||||||
|
|
||||||
class TestShellCli(TestShell):
|
class TestShellCli(TestShell):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellCli, self).setUp()
|
super(TestShellCli, self).setUp()
|
||||||
env = {
|
env = {
|
||||||
@ -706,6 +712,7 @@ class TestShellCli(TestShell):
|
|||||||
|
|
||||||
|
|
||||||
class TestShellCliEnv(TestShell):
|
class TestShellCliEnv(TestShell):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestShellCliEnv, self).setUp()
|
super(TestShellCliEnv, self).setUp()
|
||||||
env = {
|
env = {
|
||||||
|
@ -28,6 +28,7 @@ class ParserException(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class TestCase(testtools.TestCase):
|
class TestCase(testtools.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
testtools.TestCase.setUp(self)
|
testtools.TestCase.setUp(self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user