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_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_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)
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)
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)
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)
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)
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)
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)
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)
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)
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_network(self, mock_show_cleanup): cleanup.cleanup_resources(self.cloud, self.resources.get_selection()) self.assertFalse(mock_show_cleanup.called)
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)
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)
def test_cleanup_no_instance(self): cleanup.cleanup_resources(self.cloud, self.resources.get_selection()) self.assertFalse(self.cloud.delete_server.called)
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)
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)
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)
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)
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_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)
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)
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)
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_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_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)
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)
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)
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)
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)
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)