@@ -19,6 +19,7 @@ const appSettingsFixture string = `
1919 "maintenance": true,
2020 "routable": true,
2121 "whitelist": ["1.2.3.4", "0.0.0.0/0"],
22+ "autoscale": {"cmd": {"min": 3, "max": 8, "cpu_percent": 40}},
2223 "created": "2014-01-01T00:00:00UTC",
2324 "updated": "2014-01-01T00:00:00UTC",
2425 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
@@ -29,17 +30,18 @@ const appSettingsUnsetFixture string = `
2930{
3031 "owner": "test",
3132 "app": "unset-test",
32- "maintenance": true,
33+ "maintenance": true,
3334 "routable": true,
3435 "whitelist": ["1.2.3.4", "0.0.0.0/0"],
36+ "autoscale": {"cmd": {"min": 3, "max": 8, "cpu_percent": 40}},
3537 "created": "2014-01-01T00:00:00UTC",
3638 "updated": "2014-01-01T00:00:00UTC",
3739 "uuid": "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75"
3840}
3941`
4042
41- const appSettingsSetExpected string = `{"maintenance":true,"routable":true,"whitelist":["1.2.3.4","0.0.0.0/0"]}`
42- const appSettingsUnsetExpected string = `{"maintenance":true,"routable":true,"whitelist":["1.2.3.4","0.0.0.0/0"]}`
43+ const appSettingsSetExpected string = `{"maintenance":true,"routable":true,"whitelist":["1.2.3.4","0.0.0.0/0"],"autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}} }`
44+ const appSettingsUnsetExpected string = `{"maintenance":true,"routable":true,"whitelist":["1.2.3.4","0.0.0.0/0"],"autoscale":{"cmd":{"min":3,"max":8,"cpu_percent":40}} }`
4345
4446var trueVar = true
4547
@@ -129,15 +131,29 @@ func TestAppSettingsSet(t *testing.T) {
129131 Routable : api .NewRoutable (),
130132 Maintenance : & trueVar ,
131133 Whitelist : []string {"1.2.3.4" , "0.0.0.0/0" },
132- Created : "2014-01-01T00:00:00UTC" ,
133- Updated : "2014-01-01T00:00:00UTC" ,
134- UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
134+ Autoscale : map [string ]* api.Autoscale {
135+ "cmd" : {
136+ Min : 3 ,
137+ Max : 8 ,
138+ CPUPercent : 40 ,
139+ },
140+ },
141+ Created : "2014-01-01T00:00:00UTC" ,
142+ Updated : "2014-01-01T00:00:00UTC" ,
143+ UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
135144 }
136145
137146 appSettingsVars := api.AppSettings {
138147 Maintenance : & trueVar ,
139148 Routable : api .NewRoutable (),
140149 Whitelist : []string {"1.2.3.4" , "0.0.0.0/0" },
150+ Autoscale : map [string ]* api.Autoscale {
151+ "cmd" : {
152+ Min : 3 ,
153+ Max : 8 ,
154+ CPUPercent : 40 ,
155+ },
156+ },
141157 }
142158
143159 actual , err := Set (deis , "example-go" , appSettingsVars )
@@ -169,15 +185,29 @@ func TestAppSettingsUnset(t *testing.T) {
169185 Maintenance : & trueVar ,
170186 Routable : api .NewRoutable (),
171187 Whitelist : []string {"1.2.3.4" , "0.0.0.0/0" },
172- Created : "2014-01-01T00:00:00UTC" ,
173- Updated : "2014-01-01T00:00:00UTC" ,
174- UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
188+ Autoscale : map [string ]* api.Autoscale {
189+ "cmd" : {
190+ Min : 3 ,
191+ Max : 8 ,
192+ CPUPercent : 40 ,
193+ },
194+ },
195+ Created : "2014-01-01T00:00:00UTC" ,
196+ Updated : "2014-01-01T00:00:00UTC" ,
197+ UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
175198 }
176199
177200 appSettingsVars := api.AppSettings {
178201 Maintenance : & trueVar ,
179202 Routable : api .NewRoutable (),
180203 Whitelist : []string {"1.2.3.4" , "0.0.0.0/0" },
204+ Autoscale : map [string ]* api.Autoscale {
205+ "cmd" : {
206+ Min : 3 ,
207+ Max : 8 ,
208+ CPUPercent : 40 ,
209+ },
210+ },
181211 }
182212
183213 actual , err := Set (deis , "unset-test" , appSettingsVars )
@@ -209,9 +239,16 @@ func TestAppSettingsList(t *testing.T) {
209239 Maintenance : & trueVar ,
210240 Routable : api .NewRoutable (),
211241 Whitelist : []string {"1.2.3.4" , "0.0.0.0/0" },
212- Created : "2014-01-01T00:00:00UTC" ,
213- Updated : "2014-01-01T00:00:00UTC" ,
214- UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
242+ Autoscale : map [string ]* api.Autoscale {
243+ "cmd" : {
244+ Min : 3 ,
245+ Max : 8 ,
246+ CPUPercent : 40 ,
247+ },
248+ },
249+ Created : "2014-01-01T00:00:00UTC" ,
250+ Updated : "2014-01-01T00:00:00UTC" ,
251+ UUID : "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75" ,
215252 }
216253
217254 actual , err := List (deis , "example-go" )
0 commit comments