Mikko Valkonen | 20de780 | 2016-10-24 22:25:01 +0300 | [diff] [blame^] | 1 | package testing |
| 2 | |
| 3 | import ( |
| 4 | "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares" |
| 5 | th "github.com/gophercloud/gophercloud/testhelper" |
| 6 | "github.com/gophercloud/gophercloud/testhelper/client" |
| 7 | "testing" |
| 8 | ) |
| 9 | |
| 10 | func TestCreate(t *testing.T) { |
| 11 | th.SetupHTTP() |
| 12 | defer th.TeardownHTTP() |
| 13 | |
| 14 | MockCreateResponse(t) |
| 15 | |
| 16 | options := &shares.CreateOpts{Size: 1, Name: "my_test_share", ShareProto: "NFS"} |
| 17 | n, err := shares.Create(client.ServiceClient(), options).Extract() |
| 18 | |
| 19 | th.AssertNoErr(t, err) |
| 20 | th.AssertEquals(t, n.Name, "my_test_share") |
| 21 | th.AssertEquals(t, n.Size, 1) |
| 22 | th.AssertEquals(t, n.ShareProto, "NFS") |
| 23 | } |