Merge "Move class properties to instances for dhcp/test_agent.py"

This commit is contained in:
Jenkins 2016-04-19 22:07:14 +00:00 committed by Gerrit Code Review
commit 476d74e1da

View File

@ -1181,50 +1181,60 @@ class TestNetworkCache(base.BaseTestCase):
class FakePort1(object): class FakePort1(object):
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee' def __init__(self):
self.id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
class FakeV4Subnet(object): class FakeV4Subnet(object):
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd' def __init__(self):
ip_version = 4 self.id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
cidr = '192.168.0.0/24' self.ip_version = 4
gateway_ip = '192.168.0.1' self.cidr = '192.168.0.0/24'
enable_dhcp = True self.gateway_ip = '192.168.0.1'
self.enable_dhcp = True
class FakeV4SubnetOutsideGateway(FakeV4Subnet): class FakeV4SubnetOutsideGateway(FakeV4Subnet):
gateway_ip = '192.168.1.1' def __init__(self):
super(FakeV4SubnetOutsideGateway, self).__init__()
self.gateway_ip = '192.168.1.1'
class FakeV4SubnetNoGateway(object): class FakeV4SubnetNoGateway(object):
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee' def __init__(self):
ip_version = 4 self.id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
cidr = '192.168.1.0/24' self.ip_version = 4
gateway_ip = None self.cidr = '192.168.1.0/24'
enable_dhcp = True self.gateway_ip = None
self.enable_dhcp = True
class FakeV4Network(object): class FakeV4Network(object):
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' def __init__(self):
subnets = [FakeV4Subnet()] self.id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
ports = [FakePort1()] self.subnets = [FakeV4Subnet()]
namespace = 'qdhcp-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' self.ports = [FakePort1()]
self.namespace = 'qdhcp-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
class FakeV4NetworkOutsideGateway(FakeV4Network): class FakeV4NetworkOutsideGateway(FakeV4Network):
subnets = [FakeV4SubnetOutsideGateway()] def __init__(self):
super(FakeV4NetworkOutsideGateway, self).__init__()
self.subnets = [FakeV4SubnetOutsideGateway()]
class FakeV4NetworkNoSubnet(object): class FakeV4NetworkNoSubnet(object):
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' def __init__(self):
subnets = [] self.id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
ports = [] self.subnets = []
self.ports = []
class FakeV4NetworkNoGateway(object): class FakeV4NetworkNoGateway(object):
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc' def __init__(self):
subnets = [FakeV4SubnetNoGateway()] self.id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
ports = [FakePort1()] self.subnets = [FakeV4SubnetNoGateway()]
self.ports = [FakePort1()]
class TestDeviceManager(base.BaseTestCase): class TestDeviceManager(base.BaseTestCase):