File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,15 +38,15 @@ type BuildHookResponse struct {
3838
3939// Config represents a Deis application's configuration.
4040type Config struct {
41- Owner string `json:"owner"`
42- App string `json:"app"`
43- Values map [string ]string `json:"values"`
44- Memory map [string ]string `json:"memory"`
45- CPU map [string ]string `json:"cpu"`
46- Tags map [string ]string `json:"tags"`
47- UUID string `json:"uuid"`
48- Created DeisTime `json:"created"`
49- Updated DeisTime `json:"updated"`
41+ Owner string `json:"owner"`
42+ App string `json:"app"`
43+ Values map [string ]interface {} `json:"values"`
44+ Memory map [string ]string `json:"memory"`
45+ CPU map [string ]int `json:"cpu"`
46+ Tags map [string ]string `json:"tags"`
47+ UUID string `json:"uuid"`
48+ Created DeisTime `json:"created"`
49+ Updated DeisTime `json:"updated"`
5050}
5151
5252// DeisTime represents the standard datetime format used across the platform.
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ func TestParseConfigGood(t *testing.T) {
5959 resp := & http.Response {
6060 Body : & ClosingBuffer {bytes .NewBufferString (`{"owner": "test",
6161 "app": "example-go",
62- "values": {"FOO": "bar"},
62+ "values": {"FOO": "bar", "CAR": 1234 },
6363 "memory": {},
6464 "cpu": {},
6565 "tags": {},
@@ -76,7 +76,15 @@ func TestParseConfigGood(t *testing.T) {
7676 }
7777
7878 if config .Values ["FOO" ] != "bar" {
79- t .Errorf ("expected FOO='bar', got FOO='%s'" , config .Values ["FOO" ])
79+ t .Errorf ("expected FOO='bar', got FOO='%v'" , config .Values ["FOO" ])
80+ }
81+
82+ if car , ok := config .Values ["CAR" ].(float64 ); ok {
83+ if car != 1234 {
84+ t .Errorf ("expected CAR=1234, got CAR=%d" , config .Values ["CAR" ])
85+ }
86+ } else {
87+ t .Error ("expected CAR to be of type float64" )
8088 }
8189}
8290
You can’t perform that action at this time.
0 commit comments