def test_pre_delete(self): LoadBalancer.pre_delete(Mock(), self.lb) self.client.remove_group.assert_called_with(self.lb.group.pk) config = self.lb.group.environment.system.config_manager config.delete.assert_called_with(self.lb.config_key) self.lb.backend.delete_lb.assert_called_with(self.lb)
def create_lb(self): with self.patch_lb('backend') as backend: backend.create_lb.return_value = ('2.2.2.2', 443) return LoadBalancer.create(self.group, 'p', 'http', {'k': 'v'})