def test_ml_api(): response = app.test_client().post( '/predict', data=json.dumps(test_data), content_type='application/json', ) data = json.loads(response.get_data(as_text=True)) assert response.status_code == 200 assert data["ID"] == 1 assert data["value_BurningCost"] == 147.37984322575497 assert data["value_Gamma"] == 711.1153561524523 assert data["value_Poisson"] == 0.2072516673288644
def setUp(self): self.app = app.test_client()
def setUp(self): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['DEBUG'] = True self.app = app.test_client()