Michal Kobus | f611358 | 2019-09-09 15:58:21 +0200 | [diff] [blame] | 1 | package testing |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/openstack/baremetal/apiversions" |
| 7 | th "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper" |
| 8 | "gerrit.mcp.mirantis.net/debian/gophercloud.git/testhelper/client" |
| 9 | ) |
| 10 | |
| 11 | func TestListAPIVersions(t *testing.T) { |
| 12 | th.SetupHTTP() |
| 13 | defer th.TeardownHTTP() |
| 14 | |
| 15 | MockListResponse(t) |
| 16 | |
| 17 | actual, err := apiversions.List(client.ServiceClient()).Extract() |
| 18 | th.AssertNoErr(t, err) |
| 19 | |
| 20 | th.AssertDeepEquals(t, IronicAllAPIVersionResults, *actual) |
| 21 | } |
| 22 | |
| 23 | func TestGetAPIVersion(t *testing.T) { |
| 24 | th.SetupHTTP() |
| 25 | defer th.TeardownHTTP() |
| 26 | |
| 27 | MockGetResponse(t) |
| 28 | |
| 29 | actual, err := apiversions.Get(client.ServiceClient(), "v1").Extract() |
| 30 | th.AssertNoErr(t, err) |
| 31 | |
| 32 | th.AssertDeepEquals(t, IronicAPIVersion1Result, *actual) |
| 33 | } |