mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
WIP: scenario test independent of test data
This commit is contained in:
parent
44c1a0f2eb
commit
3c4624d17e
2 changed files with 2 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue