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

b/snf-cyclades-app/synnefo/db/pools/tests.py
210 210
class IPPoolTestCase(TestCase):
211 211
    def test_auto_reservations(self):
212 212
        obj = DummyObject(0)
213
        network = DummyObject(0)
214
        obj.network = network
215
        network.subnet = '192.168.2.0/24'
216
        network.gateway = '192.168.2.1'
213
        subnet = DummyObject(0)
214
        obj.subnet = subnet
215
        subnet.cidr = '192.168.2.0/24'
216
        subnet.gateway = '192.168.2.1'
217 217
        pool = IPPool(obj)
218 218
        self.assertEqual(pool.is_available('192.168.2.0'), False)
219 219
        self.assertEqual(pool.is_available('192.168.2.1'), False)
......
225 225

  
226 226
    def test_auto_reservations_2(self):
227 227
        obj = DummyObject(0)
228
        network = DummyObject(0)
229
        obj.network = network
230
        network.subnet = '192.168.2.0/31'
231
        network.gateway = '192.168.2.1'
228
        subnet = DummyObject(0)
229
        obj.subnet = subnet
230
        subnet.cidr = '192.168.2.0/31'
231
        subnet.gateway = '192.168.2.1'
232 232
        pool = IPPool(obj)
233 233
        self.assertEqual(pool.is_available('192.168.2.0'), False)
234 234
        self.assertEqual(pool.is_available('192.168.2.1'), False)

Also available in: Unified diff