Get rid of old-style classes

A Hacking rule is on the way.

Change-Id: If254c86649d7deadfb47f7dba31dd1adf7cf7fa0
This commit is contained in:
Zane Bitter 2014-08-29 14:10:30 -04:00
parent b386055238
commit ef9fc4cd92
9 changed files with 14 additions and 14 deletions

View File

@ -17,7 +17,7 @@ import six
@six.add_metaclass(abc.ABCMeta)
class ClientPlugin():
class ClientPlugin(object):
# Module which contains all exceptions classes which the client
# may emit

View File

@ -38,7 +38,7 @@ from heat.tests import utils
TEST_DEFAULT_LOGLEVELS = {'migrate': logging.WARN}
class FakeLogMixin:
class FakeLogMixin(object):
def setup_logging(self):
# Assign default logs to self.LOG so we can still
# assert on heat logs.

View File

@ -53,7 +53,7 @@ class CfnStackControllerTest(HeatTestCase):
u'Foo': u'bar'}
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8000
cfgopts = DummyConfig()
self.controller = stacks.StackController(options=cfgopts)

View File

@ -503,7 +503,7 @@ class WatchControllerTest(HeatTestCase):
self.api_version = '1.0'
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8003
cfgopts = DummyConfig()
self.controller = watches.WatchController(options=cfgopts)

View File

@ -320,7 +320,7 @@ class StackControllerTest(ControllerTest, HeatTestCase):
super(StackControllerTest, self).setUp()
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8004
cfgopts = DummyConfig()
@ -1696,7 +1696,7 @@ class ResourceControllerTest(ControllerTest, HeatTestCase):
super(ResourceControllerTest, self).setUp()
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8004
cfgopts = DummyConfig()
@ -2201,7 +2201,7 @@ class EventControllerTest(ControllerTest, HeatTestCase):
super(EventControllerTest, self).setUp()
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8004
cfgopts = DummyConfig()
@ -3245,7 +3245,7 @@ class ActionControllerTest(ControllerTest, HeatTestCase):
super(ActionControllerTest, self).setUp()
# Create WSGI controller instance
class DummyConfig():
class DummyConfig(object):
bind_port = 8004
cfgopts = DummyConfig()

View File

@ -435,7 +435,7 @@ class InstancesTest(HeatTestCase):
exc = self.assertRaises(exception.Error, instance.handle_check)
self.assertIn('foo', str(exc))
class FakeVolumeAttach:
class FakeVolumeAttach(object):
def started(self):
return False
@ -633,7 +633,7 @@ class InstancesTest(HeatTestCase):
self.m.VerifyAll()
def create_fake_iface(self, port, net, ip):
class fake_interface():
class fake_interface(object):
def __init__(self, port_id, net_id, fixed_ip):
self.port_id = port_id
self.net_id = net_id

View File

@ -156,7 +156,7 @@ class ServersTest(HeatTestCase):
return server
def _create_fake_iface(self, port, mac, ip):
class fake_interface():
class fake_interface(object):
def __init__(self, port_id, mac_addr, fixed_ip):
self.port_id = port_id
self.mac_addr = mac_addr
@ -2151,7 +2151,7 @@ class ServersTest(HeatTestCase):
return {'port': port, 'network': net, 'fixed_ip': ip, 'uuid': None}
def create_fake_iface(self, port, net, ip):
class fake_interface():
class fake_interface(object):
def __init__(self, port_id, net_id, fixed_ip):
self.port_id = port_id
self.net_id = net_id

View File

@ -1448,7 +1448,7 @@ class DBAPIStackTest(HeatTestCase):
stacks = [create_stack(self.ctx, templates[i], creds[i],
deleted_at=deleted[i]) for i in range(5)]
class MyDatetime():
class MyDatetime(object):
def now(self):
return now
self.useFixture(fixtures.MonkeyPatch('heat.db.sqlalchemy.api.datetime',

View File

@ -22,7 +22,7 @@ from heat.common import urlfetch
from heat.tests.common import HeatTestCase
class Response:
class Response(object):
def __init__(self, buf=''):
self.buf = buf