def test_cleanup_floatingIP_multiple(self):
        self.add_double()

        cleanup.cleanup_resources(
            self.cloud, self.resources.get_selection(), dry_run=False)

        self.assertEqual(2, self.cloud.delete_floating_ip.call_count)
Ejemplo n.º 2
0
 def test_cleanup_port_multiple(self):
     self.add_multiple()
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertEqual(2, mock_ports_cleanup.call_count)
Ejemplo n.º 3
0
 def test_cleanup_port(self):
     self.add_single()
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertTrue(mock_ports_cleanup.called)
    def test_cleanup_floatingIP_multiple_dry_run(self):
        self.add_double()

        cleanup.cleanup_resources(
            self.cloud, self.resources.get_selection(), dry_run=True)

        self.assertFalse(self.cloud.delete_floating_ip.called)
    def test_cleanup_floatingIP_multiple(self):
        self.add_double()

        cleanup.cleanup_resources(self.cloud,
                                  self.resources.get_selection(),
                                  dry_run=False)

        self.assertEqual(2, self.cloud.delete_floating_ip.call_count)
    def test_cleanup_floatingIP_multiple_dry_run(self):
        self.add_double()

        cleanup.cleanup_resources(self.cloud,
                                  self.resources.get_selection(),
                                  dry_run=True)

        self.assertFalse(self.cloud.delete_floating_ip.called)
 def test_cleanup_floatingIP_micro(self, mock_floatingIP_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertTrue(mock_floatingIP_cleanup.called)
 def test_cleanup_no_floatingIP(self):
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertFalse(self.cloud.delete_floating_ip.called)
Ejemplo n.º 9
0
 def test_cleanup_keypair_micro(self, mock_keypairs_cleanup):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_cleanup)
     self.assertTrue(mock_keypairs_cleanup.called)
Ejemplo n.º 10
0
 def test_dry_cleanup_port_multiple(self, mock_ports_cleanup):
     self.add_multiple()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertEqual(2, mock_ports_cleanup.call_count)
Ejemplo n.º 11
0
 def test_dry_cleanup_network(self, mock_show_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_show_cleanup.called)
Ejemplo n.º 12
0
 def test_cleanup_stack(self):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection(),
                               dry_cleanup)
     self.assertTrue(self.cloud.delete_stack.called)
Ejemplo n.º 13
0
 def test_cleanup_instance(self):
     self.add_single()
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertTrue(self.cloud.delete_server.called)
Ejemplo n.º 14
0
 def test_cleanup_no_router(self, mock_routers_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_routers_cleanup.called)
     self.assertFalse(self.cloud.delete_router.called)
Ejemplo n.º 15
0
 def test_cleanup_no_subnet(self, mock_subnets_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_subnets_cleanup.called)
     self.assertFalse(self.cloud.delete_subnet.called)
Ejemplo n.º 16
0
 def test_dry_cleanup_no_secgroup(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_security_group.called)
Ejemplo n.º 17
0
 def test_cleanup_secgroup(self):
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertTrue(self.cloud.delete_security_group.called)
Ejemplo n.º 18
0
 def test_cleanup_no_network(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_show_cleanup.called)
Ejemplo n.º 19
0
 def test_cleanup_stack(self):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_cleanup)
     self.assertTrue(self.cloud.delete_stack.called)
Ejemplo n.º 20
0
 def test_dry_cleanup_stack_micro(self, mock_stacks_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_stacks_cleanup.called)
Ejemplo n.º 21
0
 def test_cleanup_no_instance(self):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_server.called)
Ejemplo n.º 22
0
 def test_cleanup_no_stack_micro(self, mock_stacks_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_stacks_cleanup.called)
Ejemplo n.º 23
0
 def test_cleanup_secgroup(self):
     self.add_single()
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertTrue(self.cloud.delete_security_group.called)
 def test_cleanup_no_floatingIP(self):
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertFalse(self.cloud.delete_floating_ip.called)
Ejemplo n.º 25
0
 def test_dry_cleanup_no_secgroup(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_security_group.called)
Ejemplo n.º 26
0
 def test_cleanup_keypair(self):
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertTrue(self.cloud.delete_keypair.called)
 def test_dry_cleanup_router_interface(self, mock_routers_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_routers_cleanup.called)
Ejemplo n.º 28
0
 def test_cleanup_no_port_dry(self, mock_ports_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_ports_cleanup.called)
 def test_cleanup_router_interface(self):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_cleanup)
     self.assertTrue(self.cloud.remove_router_interface.called)
 def test_cleanup_no_floatingIP_dry(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_show_cleanup.called)
 def test_cleanup_no_router_interface(self, mock_routers_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_routers_cleanup.called)
     self.assertFalse(self.cloud.remove_router_interface.called)
 def test_dry_cleanup_router_interface_multi(self, mock_routers_cleanup):
     self.add_multiple()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertEqual(3, mock_routers_cleanup.call_count)
 def test_cleanup_router_interface_multi(self):
     self.add_multiple()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertEqual(2, self.cloud.remove_router_interface.call_count)
Ejemplo n.º 34
0
 def test_cleanup_no_router(self, mock_routers_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_routers_cleanup.called)
     self.assertFalse(self.cloud.delete_router.called)
Ejemplo n.º 35
0
 def test_dry_cleanup_no_keypair(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_keypair.called)
Ejemplo n.º 36
0
 def test_cleanup_no_stack(self, mock_stacks_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_stacks_cleanup.called)
     self.assertFalse(self.cloud.delete_stack.called)
Ejemplo n.º 37
0
 def test_dry_cleanup_keypair_micro(self, mock_keypairs_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_keypairs_cleanup.called)
Ejemplo n.º 38
0
 def test_dry_cleanup_stack(self, mock_stacks_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_stacks_cleanup.called)
 def test_cleanup_router_interface(self):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection(),
                               dry_cleanup)
     self.assertTrue(self.cloud.remove_router_interface.called)
Ejemplo n.º 40
0
 def test_cleanup_stack_micro(self, mock_stacks_cleanup):
     dry_cleanup = False
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection(),
                               dry_cleanup)
     self.assertTrue(mock_stacks_cleanup.called)
 def test_dry_cleanup_router_interface_multi(self, mock_routers_cleanup):
     self.add_multiple()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertEqual(3, mock_routers_cleanup.call_count)
 def test_dry_cleanup_router_interface(self, mock_routers_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertTrue(mock_routers_cleanup.called)
Ejemplo n.º 43
0
 def test_cleanup_port_multiple(self):
     self.add_multiple()
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertEqual(2, mock_ports_cleanup.call_count)
 def test_cleanup_no_router_interface(self, mock_routers_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_routers_cleanup.called)
     self.assertFalse(self.cloud.remove_router_interface.called)
Ejemplo n.º 45
0
 def test_cleanup_no_port_dry(self, mock_ports_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_ports_cleanup.called)
 def test_cleanup_router_interface_multi(self):
     self.add_multiple()
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertEqual(2, self.cloud.remove_router_interface.call_count)
 def test_cleanup_no_floatingIP_micro(self, mock_floatingIP_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_floatingIP_cleanup.called)
Ejemplo n.º 48
0
 def test_cleanup_no_port(self):
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_ports_cleanup.called)
Ejemplo n.º 49
0
 def test_cleanup_no_port(self):
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_ports_cleanup.called)
 def test_cleanup_floatingIP_micro(self, mock_floatingIP_cleanup):
     self.add_single()
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertTrue(mock_floatingIP_cleanup.called)
Ejemplo n.º 51
0
 def test_dry_cleanup_port_multiple(self, mock_ports_cleanup):
     self.add_multiple()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertEqual(2, mock_ports_cleanup.call_count)
Ejemplo n.º 52
0
 def test_dry_cleanup_keypair(self, mock_show_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_keypair.called)
     self.assertTrue(mock_show_cleanup.called)
 def test_dry_cleanup_floatingIP(self, mock_show_cleanup):
     self.add_single()
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_floating_ip.called)
     self.assertTrue(mock_show_cleanup.called)
Ejemplo n.º 54
0
 def test_dry_cleanup_no_keypair(self, mock_show_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(self.cloud.delete_keypair.called)
 def test_cleanup_floatingIP(self):
     self.add_single()
     cleanup.cleanup_resources(self.cloud,
                               self.resources.get_selection(),
                               dry_run=False)
     self.assertTrue(self.cloud.delete_floating_ip.called)
Ejemplo n.º 56
0
 def test_cleanup_no_keypair_micro(self, mock_keypairs_cleanup):
     cleanup.cleanup_resources(self.cloud, self.resources.get_selection())
     self.assertFalse(mock_keypairs_cleanup.called)
Ejemplo n.º 57
0
 def test_cleanup_port(self):
     self.add_single()
     mock_ports_cleanup = self.cloud.delete_port
     cleanup.cleanup_resources(
         self.cloud, self.resources.get_selection(), dry_run=False)
     self.assertTrue(mock_ports_cleanup.called)