~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/gopkg.in/goose.v1/identity/live_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package identity_test
 
2
 
 
3
import (
 
4
        "net/url"
 
5
 
 
6
        gc "gopkg.in/check.v1"
 
7
 
 
8
        "gopkg.in/goose.v1/client"
 
9
        "gopkg.in/goose.v1/identity"
 
10
)
 
11
 
 
12
func registerOpenStackTests(cred *identity.Credentials, authMode identity.AuthMode) {
 
13
        gc.Suite(&LiveTests{
 
14
                cred:     cred,
 
15
                authMode: authMode,
 
16
        })
 
17
}
 
18
 
 
19
type LiveTests struct {
 
20
        cred     *identity.Credentials
 
21
        client   client.AuthenticatingClient
 
22
        authMode identity.AuthMode
 
23
}
 
24
 
 
25
func (s *LiveTests) SetUpSuite(c *gc.C) {
 
26
        s.client = client.NewClient(s.cred, s.authMode, nil)
 
27
}
 
28
 
 
29
func (s *LiveTests) TearDownSuite(c *gc.C) {
 
30
}
 
31
 
 
32
func (s *LiveTests) SetUpTest(c *gc.C) {
 
33
        // noop, called by local test suite.
 
34
}
 
35
 
 
36
func (s *LiveTests) TearDownTest(c *gc.C) {
 
37
        // noop, called by local test suite.
 
38
}
 
39
 
 
40
func (s *LiveTests) TestAuth(c *gc.C) {
 
41
        err := s.client.Authenticate()
 
42
        c.Assert(err, gc.IsNil)
 
43
        serviceURL, err := s.client.MakeServiceURL("compute", []string{})
 
44
        c.Assert(err, gc.IsNil)
 
45
        _, err = url.Parse(serviceURL)
 
46
        c.Assert(err, gc.IsNil)
 
47
}