mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
remove commented old code
This commit is contained in:
parent
4914af6c47
commit
a8cccba667
1 changed files with 0 additions and 54 deletions
|
@ -308,57 +308,3 @@ func TestGetAllSimulationModelsOfScenario(t *testing.T) {
|
|||
assert.Equal(t, 1, NumberOfSimulationModels)
|
||||
|
||||
}
|
||||
|
||||
//// Test /models endpoints
|
||||
//func TestSimulationModelEndpoints(t *testing.T) {
|
||||
//
|
||||
// var token string
|
||||
//
|
||||
// var myModels = []common.SimulationModelResponse{common.SimulationModelA_response, common.SimulationModelB_response}
|
||||
// var msgModels = common.ResponseMsgSimulationModels{SimulationModels: myModels}
|
||||
// var msgModel = common.ResponseMsgSimulationModel{SimulationModel: common.SimulationModelC_response}
|
||||
// var msgModelupdated = common.ResponseMsgSimulationModel{SimulationModel: common.SimulationModelCUpdated_response}
|
||||
//
|
||||
// db := common.DummyInitDB()
|
||||
// defer db.Close()
|
||||
// common.DummyPopulateDB(db)
|
||||
//
|
||||
// router := gin.Default()
|
||||
// api := router.Group("/api")
|
||||
//
|
||||
// // All endpoints require authentication except when someone wants to
|
||||
// // login (POST /authenticate)
|
||||
// user.RegisterAuthenticate(api.Group("/authenticate"))
|
||||
//
|
||||
// api.Use(user.Authentication(true))
|
||||
//
|
||||
// RegisterSimulationModelEndpoints(api.Group("/models"))
|
||||
//
|
||||
// credjson, _ := json.Marshal(common.CredUser)
|
||||
// msgOKjson, _ := json.Marshal(common.MsgOK)
|
||||
// msgModelsjson, _ := json.Marshal(msgModels)
|
||||
// msgModeljson, _ := json.Marshal(msgModel)
|
||||
// msgModelupdatedjson, _ := json.Marshal(msgModelupdated)
|
||||
//
|
||||
// token = common.AuthenticateForTest(t, router, "/api/authenticate", "POST", credjson, 200)
|
||||
//
|
||||
// // test GET models
|
||||
// common.TestEndpoint(t, router, token, "/api/models?scenarioID=1", "GET", nil, 200, msgModelsjson)
|
||||
//
|
||||
// // test POST models
|
||||
// common.TestEndpoint(t, router, token, "/api/models", "POST", msgModeljson, 200, msgOKjson)
|
||||
//
|
||||
// // test GET models/:ModelID to check if previous POST worked correctly
|
||||
// common.TestEndpoint(t, router, token, "/api/models/3", "GET", nil, 200, msgModeljson)
|
||||
//
|
||||
// // test PUT models/:ModelID
|
||||
// common.TestEndpoint(t, router, token, "/api/models/3", "PUT", msgModelupdatedjson, 200, msgOKjson)
|
||||
// common.TestEndpoint(t, router, token, "/api/models/3", "GET", nil, 200, msgModelupdatedjson)
|
||||
//
|
||||
// // test DELETE models/:ModelID
|
||||
// common.TestEndpoint(t, router, token, "/api/models/3", "DELETE", nil, 200, msgOKjson)
|
||||
// common.TestEndpoint(t, router, token, "/api/models?scenarioID=1", "GET", nil, 200, msgModelsjson)
|
||||
//
|
||||
// // TODO add testing for other return codes
|
||||
//
|
||||
//}
|
||||
|
|
Loading…
Add table
Reference in a new issue