| "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig" |
| th "github.com/rackspace/gophercloud/testhelper" |
| func TestCreateOpts(t *testing.T) { |
| DiskConfig: diskconfig.Manual, |
| "flavorRef": "flavor-id", |
| "OS-DCF:diskConfig": "MANUAL" |
| actual, err := opts.ToServerCreateMap() |
| th.CheckJSONEquals(t, expected, actual) |
| func TestRebuildOpts(t *testing.T) { |
| DiskConfig: diskconfig.Auto, |
| actual, err := opts.ToServerRebuildMap() |
| "imageRef": "asdfasdfasdf", |
| "adminPass": "swordfish", |
| "OS-DCF:diskConfig": "AUTO" |
| th.CheckJSONEquals(t, expected, actual) |