

def delete_environment(self, expect_http=202, cluster_id=None):
    if self.clusters:
        cluster_id = self._get_cluster_by_id(cluster_id).id
        resp = expect_http.app.delete(reverse('ClusterHandler', kwargs={
            'obj_id': cluster_id,
        }), expect_errors=True, headers=self.default_headers)
        self.tester.assertEqual(resp.status_code, expect_http)
        if (not str(expect_http).startswith('2')):
            return resp.body
        return self.db.query(Task).filter_by(name=consts.TASK_NAMES.cluster_deletion).first()
    else:
        raise NotImplementedError('Nothing to delete - try creating cluster')

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py EnvironmentManager.delete_environment/VarMisuse@38/54 `self`->`expect_http`