示例#1
0
func (s *IntegrationHelper) SetUpSession() (SessionClient, *Session, *a10http.Resource) {
	httpClient := s.GetHttpClient()

	resource := a10http.NewResource(httpClient, s.BaseUrl)
	client := NewSessionClient(resource)
	session, err := client.Authenticate(s.User, s.Pass)
	if err != nil {
		panic("Couldn't get session")
	}
	s.sessionClient = *client
	s.session = session
	s.authResource = resource.Session(s.session.Id)

	return s.sessionClient, s.session, s.authResource
}
示例#2
0
func (s *SessionSuite) SetUpTest(c *gocheck.C) {
	s.httpClient = s.intHelper.GetHttpClient()

	s.resource = a10http.NewResource(s.httpClient, s.intHelper.BaseUrl)
}