Revision ddffd973 snf-cyclades-app/synnefo/logic/tests/reconciliation.py

b/snf-cyclades-app/synnefo/logic/tests/reconciliation.py
244 244
                                             "external_reservations": ""}]
245 245
        self.reconciler.reconcile_networks()
246 246
        self.assertTrue(net1.backend_networks
247
                            .filter(backend=self.backend).exists())
248
        # ..but not if it is destroying
249
        net1.backend_networks.all().delete()
250
        net1.action = "DESTROY"
251
        net1.save()
252
        self.reconciler.reconcile_networks()
253
        self.assertFalse(net1.backend_networks
254
                             .filter(backend=self.backend).exists())
255
        # or network is public!
256
        net1.action = "CREATE"
257
        net1.public = True
258
        net1.save()
259
        self.reconciler.reconcile_networks()
260
        self.assertFalse(net1.backend_networks
261
                             .filter(backend=self.backend).exists())
262
        # Test creation if network is a floating IP pool
263
        net2 = mfactory.NetworkWithSubnetFactory(floating_ip_pool=True)
264
        mrapi().GetNetworks.return_value = []
265
        self.assertEqual(net2.backend_networks.count(), 0)
266
        self.reconciler.reconcile_networks()
267
        self.assertTrue(net2.backend_networks
268
                            .filter(backend=self.backend).exists())
247
                        .filter(backend=self.backend).exists())
269 248

  
270 249
    def test_stale_network(self, mrapi):
271 250
        # Test that stale network will be deleted from DB, if network action is

Also available in: Unified diff