@@ -44,6 +44,18 @@ const SingleFlavorBody = `
4444}
4545`
4646
47+ const SingleFlavorDisabledBody = `
48+ {
49+ "flavor": {
50+ "id": "5548c807-e6e8-43d7-9ea4-b38d34dd74a0",
51+ "name": "Basic",
52+ "description": "A basic standalone Octavia load balancer.",
53+ "enabled": false,
54+ "flavor_profile_id": "9daa2768-74e7-4d13-bf5d-1b8e0dc239e1"
55+ }
56+ }
57+ `
58+
4759const PostUpdateFlavorBody = `
4860{
4961 "flavor": {
8193 FlavorProfileId : "9daa2768-74e7-4d13-bf5d-1b8e0dc239e1" ,
8294 }
8395
96+ FlavorDisabled = flavors.Flavor {
97+ ID : "5548c807-e6e8-43d7-9ea4-b38d34dd74a0" ,
98+ Name : "Basic" ,
99+ Description : "A basic standalone Octavia load balancer." ,
100+ Enabled : false ,
101+ FlavorProfileId : "9daa2768-74e7-4d13-bf5d-1b8e0dc239e1" ,
102+ }
103+
84104 FlavorUpdated = flavors.Flavor {
85105 ID : "5548c807-e6e8-43d7-9ea4-b38d34dd74a0" ,
86106 Name : "Basic v2" ,
@@ -130,6 +150,25 @@ func HandleFlavorCreationSuccessfully(t *testing.T, response string) {
130150 })
131151}
132152
153+ func HandleFlavorCreationSuccessfullyDisabled (t * testing.T , response string ) {
154+ th .Mux .HandleFunc ("/v2.0/lbaas/flavors" , func (w http.ResponseWriter , r * http.Request ) {
155+ th .TestMethod (t , r , "POST" )
156+ th .TestHeader (t , r , "X-Auth-Token" , client .TokenID )
157+ th .TestJSONRequest (t , r , `{
158+ "flavor": {
159+ "name": "Basic",
160+ "description": "A basic standalone Octavia load balancer.",
161+ "enabled": false,
162+ "flavor_profile_id": "9daa2768-74e7-4d13-bf5d-1b8e0dc239e1"
163+ }
164+ }` )
165+
166+ w .WriteHeader (http .StatusAccepted )
167+ w .Header ().Add ("Content-Type" , "application/json" )
168+ fmt .Fprintf (w , response )
169+ })
170+ }
171+
133172func HandleFlavorGetSuccessfully (t * testing.T ) {
134173 th .Mux .HandleFunc ("/v2.0/lbaas/flavors/5548c807-e6e8-43d7-9ea4-b38d34dd74a0" , func (w http.ResponseWriter , r * http.Request ) {
135174 th .TestMethod (t , r , "GET" )
0 commit comments