blob: 999718ba324f4b19d0d429fc2dda1076c518da65 [file] [log] [blame]
Ash Wilsonae0ca652014-10-23 12:30:12 -04001package servers
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig"
7 th "github.com/rackspace/gophercloud/testhelper"
8)
9
10func TestCreateOpts(t *testing.T) {
11 opts := CreateOpts{
12 Name: "createdserver",
13 ImageRef: "image-id",
14 FlavorRef: "flavor-id",
15 KeyPair: "mykey",
16 DiskConfig: diskconfig.Manual,
17 }
18
19 expected := `
20 {
21 "server": {
22 "name": "createdserver",
23 "imageRef": "image-id",
24 "flavorRef": "flavor-id",
25 "key_name": "mykey",
26 "OS-DCF:diskConfig": "MANUAL"
27 }
28 }
29 `
30 th.CheckJSONEquals(t, expected, opts.ToServerCreateMap())
31}