github.com/gophercloud/gophercloud@v1.11.0/openstack/baremetal/apiversions/testing/requests_test.go (about)

     1  package testing
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/gophercloud/gophercloud/openstack/baremetal/apiversions"
     7  	th "github.com/gophercloud/gophercloud/testhelper"
     8  	"github.com/gophercloud/gophercloud/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  }