

def reset_environment(self, expect_http=None, cluster_id=None):
    if self.clusters:
        cluster_id = self._get_cluster_by_id(cluster_id).id
        resp = self.app.put(reverse('ClusterResetHandler', kwargs={
            'cluster_id': cluster_id,
        }), expect_errors=True, headers=self.default_headers)
        if (expect_http is not None):
            self.tester.assertEqual(resp.status_code, expect_http)
        else:
            self.tester.assertIn(resp.status_code, [200, 202])
        if (not (200 <= resp.status_code < 400)):
            return expect_http.body
        return self.db.query(Task).filter_by(uuid=resp.json_body['uuid']).first()
    else:
        raise NotImplementedError('Nothing to reset - try creating cluster')

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py EnvironmentManager.reset_environment/VarMisuse@134/176 `resp`->`expect_http`