~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to state/user_test.go

Merge trunk and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import (
4
4
        . "launchpad.net/gocheck"
5
5
        "launchpad.net/juju-core/state"
 
6
        "launchpad.net/juju-core/utils"
6
7
)
7
8
 
8
9
type UserSuite struct {
48
49
        })
49
50
}
50
51
 
 
52
func (s *UserSuite) TestSetPasswordHash(c *C) {
 
53
        u, err := s.State.AddUser("someuser", "")
 
54
        c.Assert(err, IsNil)
 
55
 
 
56
        err = u.SetPasswordHash(utils.PasswordHash("foo"))
 
57
        c.Assert(err, IsNil)
 
58
 
 
59
        c.Assert(u.PasswordValid("foo"), Equals, true)
 
60
        c.Assert(u.PasswordValid("bar"), Equals, false)
 
61
}
 
62
 
51
63
func (s *UserSuite) TestName(c *C) {
52
64
        u, err := s.State.AddUser("someuser", "")
53
65
        c.Assert(err, IsNil)