Revision 8c7c9813 snf-cyclades-app/synnefo/db/tests.py

b/snf-cyclades-app/synnefo/db/tests.py
132 132
        with override_settings(snf_settings,
133 133
                               GANETI_CREATEINSTANCE_KWARGS=kwargs):
134 134
            self.assertEqual(kvm_backend.get_create_params(),
135
                    {"os": "snf-image+default",
136
                     "hvparams": {"foo1": "mpaz1"}})
135
                             {"os": "snf-image+default",
136
                              "hvparams": {"foo1": "mpaz1"}})
137 137
            self.assertEqual(xen_pvm_backend.get_create_params(),
138
                    {"os": "snf-image+default",
139
                     "hvparams": {"foo2": "mpaz2"}})
138
                             {"os": "snf-image+default",
139
                              "hvparams": {"foo2": "mpaz2"}})
140 140
            self.assertEqual(xen_hvm_backend.get_create_params(),
141
                    {"os": "snf-image+default",
142
                     "hvparams": {"foo3": "mpaz3"}})
141
                             {"os": "snf-image+default",
142
                              "hvparams": {"foo3": "mpaz3"}})
143 143
        with override_settings(snf_settings, GANETI_CREATEINSTANCE_KWARGS={}):
144 144
            self.assertEqual(kvm_backend.get_create_params(), {"hvparams": {}})
145 145

  
......
172 172

  
173 173
class NetworkTest(TestCase):
174 174
    def setUp(self):
175
        self.net = mfact.NetworkFactory()
175
        self.net = mfact.NetworkWithSubnetFactory()
176 176

  
177 177
    def test_tags(self):
178 178
        net1 = mfact.NetworkFactory(flavor='IP_LESS_ROUTED')
......
199 199
        self.assertTrue(isinstance(pool, IPPool))
200 200

  
201 201
    def test_reserve_ip(self):
202
        net1 = mfact.NetworkFactory(subnet='192.168.2.0/24')
202
        net1 = mfact.NetworkWithSubnetFactory(subnet__cidr='192.168.2.0/24')
203 203
        net1.reserve_address('192.168.2.12')
204 204
        pool = net1.get_pool()
205 205
        self.assertFalse(pool.is_available('192.168.2.12'))
......
220 220
        network = mfact.NetworkFactory(mac_prefix='zz:bb:c')
221 221
        backend = mfact.BackendFactory()
222 222
        self.assertRaises(utils.InvalidMacAddress,
223
                mfact.BackendNetworkFactory, network=network, backend=backend)
223
                          mfact.BackendNetworkFactory,
224
                          network=network, backend=backend)
224 225

  
225 226

  
226 227
class BridgePoolTest(TestCase):

Also available in: Unified diff