github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/identity/v3/tokens/testing/results_test.go (about)

     1  package testing
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/huaweicloud/golangsdk/testhelper"
     7  )
     8  
     9  func TestExtractToken(t *testing.T) {
    10  	result := getGetResult(t)
    11  
    12  	token, err := result.ExtractToken()
    13  	testhelper.AssertNoErr(t, err)
    14  
    15  	testhelper.CheckDeepEquals(t, &ExpectedToken, token)
    16  }
    17  
    18  func TestExtractCatalog(t *testing.T) {
    19  	result := getGetResult(t)
    20  
    21  	catalog, err := result.ExtractServiceCatalog()
    22  	testhelper.AssertNoErr(t, err)
    23  
    24  	testhelper.CheckDeepEquals(t, &ExpectedServiceCatalog, catalog)
    25  }
    26  
    27  func TestExtractUser(t *testing.T) {
    28  	result := getGetResult(t)
    29  
    30  	user, err := result.ExtractUser()
    31  	testhelper.AssertNoErr(t, err)
    32  
    33  	testhelper.CheckDeepEquals(t, &ExpectedUser, user)
    34  }
    35  
    36  func TestExtractRoles(t *testing.T) {
    37  	result := getGetResult(t)
    38  
    39  	roles, err := result.ExtractRoles()
    40  	testhelper.AssertNoErr(t, err)
    41  
    42  	testhelper.CheckDeepEquals(t, ExpectedRoles, roles)
    43  }
    44  
    45  func TestExtractProject(t *testing.T) {
    46  	result := getGetResult(t)
    47  
    48  	project, err := result.ExtractProject()
    49  	testhelper.AssertNoErr(t, err)
    50  
    51  	testhelper.CheckDeepEquals(t, &ExpectedProject, project)
    52  }