~juju-qa/ubuntu/trusty/juju/juju-1.25.8

« back to all changes in this revision

Viewing changes to src/gopkg.in/goose.v1/testservices/identityservice/service_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-12-02 18:01:10 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161202180110-dl1helep8qfebmhx
ImportĀ upstreamĀ 1.25.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package identityservice
 
2
 
 
3
import (
 
4
        gc "gopkg.in/check.v1"
 
5
 
 
6
        "gopkg.in/goose.v1/testing/httpsuite"
 
7
)
 
8
 
 
9
// All tests in the IdentityServiceSuite run against each IdentityService
 
10
// implementation.
 
11
 
 
12
type IdentityServiceSuite struct {
 
13
        httpsuite.HTTPSuite
 
14
        service IdentityService
 
15
}
 
16
 
 
17
var _ = gc.Suite(&IdentityServiceSuite{service: NewUserPass()})
 
18
var _ = gc.Suite(&IdentityServiceSuite{service: NewLegacy()})
 
19
 
 
20
func (s *IdentityServiceSuite) TestAddUserGivesNewToken(c *gc.C) {
 
21
        userInfo1 := s.service.AddUser("user-1", "password-1", "tenant")
 
22
        userInfo2 := s.service.AddUser("user-2", "password-2", "tenant")
 
23
        c.Assert(userInfo1.Token, gc.Not(gc.Equals), userInfo2.Token)
 
24
}