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:
Brandon Palm 2016-02-23 10:38:58 -06:00
parent c949802f9a
commit b1ee642b43
12 changed files with 29 additions and 1 deletions

View File

@ -37,6 +37,7 @@ USER_AGENT = 'python-openstackclient'
class ClientCache(object):
"""Descriptor class for caching created client handles."""
def __init__(self, factory):
self.factory = factory
self._handle = None

View File

@ -22,6 +22,7 @@ import six
class CommandMeta(abc.ABCMeta):
def __new__(mcs, name, bases, cls_dict):
if 'log' not in cls_dict:
cls_dict['log'] = logging.getLogger(

View File

@ -41,6 +41,7 @@ class UnsupportedVersion(Exception):
class ClientException(Exception):
"""The base exception class for all exceptions this library raises."""
def __init__(self, code, message=None, details=None):
self.code = code
self.message = message or self.__class__.message

View File

@ -47,6 +47,7 @@ class Container(object):
class FakeOptions(object):
def __init__(self, **kwargs):
for option in auth.OPTIONS_LIST:
setattr(self, option.replace('-', '_'), None)
@ -71,6 +72,7 @@ class TestClientCache(utils.TestCase):
class TestClientManager(utils.TestCase):
def setUp(self):
super(TestClientManager, self).setUp()
self.mock = mock.Mock()

View File

@ -19,6 +19,7 @@ from openstackclient.tests import utils as test_utils
class FakeCommand(command.Command):
def take_action(self, parsed_args):
pass

View File

@ -20,6 +20,7 @@ from openstackclient.tests import utils
class FakeCommand(object):
@classmethod
def load(cls):
return cls
@ -48,6 +49,7 @@ class FakeCommandManager(commandmanager.CommandManager):
class TestCommandManager(utils.TestCase):
def test_add_command_group(self):
mgr = FakeCommandManager('test')

View File

@ -66,6 +66,7 @@ class TestContext(utils.TestCase):
class TestFileFormatter(utils.TestCase):
def test_nothing(self):
formatter = logs._FileFormatter()
self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
@ -93,6 +94,7 @@ class TestFileFormatter(utils.TestCase):
class TestLogConfigurator(utils.TestCase):
def setUp(self):
super(TestLogConfigurator, self).setUp()
self.options = mock.Mock()

View File

@ -75,7 +75,7 @@ class TestTiming(utils.TestCommand):
def test_timing_list(self):
self.app.timing_data = [(
timing_url,
datetime.timedelta(microseconds=timing_elapsed*1000000),
datetime.timedelta(microseconds=timing_elapsed * 1000000),
)]
arglist = []

View File

@ -250,6 +250,7 @@ class NoUniqueMatch(Exception):
class TestFindResource(test_utils.TestCase):
def setUp(self):
super(TestFindResource, self).setUp()
self.name = 'legos'

View File

@ -51,6 +51,7 @@ TEST_VERSIONS = fixture.DiscoveryList(href=AUTH_URL)
class FakeStdout(object):
def __init__(self):
self.content = []
@ -65,6 +66,7 @@ class FakeStdout(object):
class FakeLog(object):
def __init__(self):
self.messages = {}
@ -85,6 +87,7 @@ class FakeLog(object):
class FakeApp(object):
def __init__(self, _stdout, _log):
self.stdout = _stdout
self.client_manager = None
@ -95,12 +98,14 @@ class FakeApp(object):
class FakeClient(object):
def __init__(self, **kwargs):
self.endpoint = kwargs['endpoint']
self.token = kwargs['token']
class FakeClientManager(object):
def __init__(self):
self.compute = None
self.identity = None
@ -129,12 +134,14 @@ class FakeClientManager(object):
class FakeModule(object):
def __init__(self, name, version):
self.name = name
self.__version__ = version
class FakeResource(object):
def __init__(self, manager=None, info={}, loaded=False, methods={}):
"""Set attributes and methods for a resource.
@ -178,6 +185,7 @@ class FakeResource(object):
class FakeResponse(requests.Response):
def __init__(self, headers={}, status_code=200, data=None, encoding=None):
super(FakeResponse, self).__init__()
@ -190,6 +198,7 @@ class FakeResponse(requests.Response):
class FakeModel(dict):
def __getattr__(self, key):
try:
return self[key]

View File

@ -161,6 +161,7 @@ def fake_execute(shell, cmd):
class TestShell(utils.TestCase):
def setUp(self):
super(TestShell, self).setUp()
patch = "openstackclient.shell.OpenStackShell.run_subcommand"
@ -280,6 +281,7 @@ class TestShell(utils.TestCase):
class TestShellHelp(TestShell):
"""Test the deferred help flag"""
def setUp(self):
super(TestShellHelp, self).setUp()
self.orig_env, os.environ = os.environ, {}
@ -304,6 +306,7 @@ class TestShellHelp(TestShell):
class TestShellOptions(TestShell):
def setUp(self):
super(TestShellOptions, self).setUp()
self.orig_env, os.environ = os.environ, {}
@ -391,6 +394,7 @@ class TestShellOptions(TestShell):
class TestShellTokenAuthEnv(TestShell):
def setUp(self):
super(TestShellTokenAuthEnv, self).setUp()
env = {
@ -438,6 +442,7 @@ class TestShellTokenAuthEnv(TestShell):
class TestShellTokenEndpointAuthEnv(TestShell):
def setUp(self):
super(TestShellTokenEndpointAuthEnv, self).setUp()
env = {
@ -485,6 +490,7 @@ class TestShellTokenEndpointAuthEnv(TestShell):
class TestShellCli(TestShell):
def setUp(self):
super(TestShellCli, self).setUp()
env = {
@ -706,6 +712,7 @@ class TestShellCli(TestShell):
class TestShellCliEnv(TestShell):
def setUp(self):
super(TestShellCliEnv, self).setUp()
env = {

View File

@ -28,6 +28,7 @@ class ParserException(Exception):
class TestCase(testtools.TestCase):
def setUp(self):
testtools.TestCase.setUp(self)