blob: 8470c0c898526c55894c36ed94c7f1c95d4a7445 [file] [log] [blame]
Jamie Hannafordfac40db2015-02-09 17:27:08 +01001package instances
2
3import (
4 "testing"
5
6 th "github.com/rackspace/gophercloud/testhelper"
7 fake "github.com/rackspace/gophercloud/testhelper/client"
8)
9
10func TestCreate(t *testing.T) {
11 th.SetupHTTP()
12 defer th.TeardownHTTP()
13
14 HandleCreateInstanceSuccessfully(t)
15
16 opts := CreateOpts{
17 Name: "json_rack_instance",
18 FlavorRef: "1",
19 Databases: DatabasesOpts{
20 DatabaseOpts{CharSet: "utf8", Collate: "utf8_general_ci", Name: "sampledb"},
21 DatabaseOpts{Name: "nextround"},
22 },
23 Users: UsersOpts{
24 UserOpts{
25 Name: "demouser",
26 Password: "demopassword",
27 Databases: DatabasesOpts{
28 DatabaseOpts{Name: "sampledb"},
29 },
30 },
31 },
32 Size: 2,
33 RestorePoint: "1234567890",
34 }
35
36 _ = Create(fake.ServiceClient(), opts)
37}