Commit 3c4624d1 authored by Sonja Happ's avatar Sonja Happ
Browse files

WIP: scenario test independent of test data

parent 44c1a0f2
......@@ -25,7 +25,6 @@ import (
"encoding/json"
"fmt"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/database"
"github.com/jinzhu/gorm/dialects/postgres"
"golang.org/x/crypto/bcrypt"
"io/ioutil"
"log"
......@@ -85,16 +84,6 @@ type UserRequest struct {
Active string `json:"active,omitempty"`
}
// Scenarios
var startParametersA = json.RawMessage(`{"parameter1" : "testValue1A", "parameter2" : "testValue2A", "parameter3" : 42}`)
var ScenarioA = database.Scenario{
Name: "Scenario_A",
Running: true,
StartParameters: postgres.Jsonb{startParametersA},
}
func ReadTestDataFromJson(path string) error {
jsonFile, err := os.Open(path)
......
......@@ -212,8 +212,8 @@ func TestUpdateScenario(t *testing.T) {
updatedScenario := ScenarioRequest{
Name: "Updated name",
Running: !helper.ScenarioA.Running,
StartParameters: helper.ScenarioA.StartParameters,
Running: false,
StartParameters: postgres.Jsonb{RawMessage: json.RawMessage(`{"parameter1" : "testValue1A", "parameter2" : "testValue2A", "parameter3" : 42}`)},
}
// try to update with non JSON body
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment