18
18
var _ = gc.Suite(&RemoveUserSuite{})
20
20
func (s *RemoveUserSuite) TestRemoveUser(c *gc.C) {
21
_, err := testing.RunCommand(c, envcmd.Wrap(&UserAddCommand{}), []string{"foobar"})
21
_, err := testing.RunCommand(c, envcmd.Wrap(&UserAddCommand{}), "foobar")
22
22
c.Assert(err, gc.IsNil)
24
_, err = testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{"foobar"})
24
_, err = testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), "foobar")
25
25
c.Assert(err, gc.IsNil)
28
28
func (s *RemoveUserSuite) TestTooManyArgs(c *gc.C) {
29
_, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{"foobar", "password"})
29
_, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), "foobar", "password")
30
30
c.Assert(err, gc.ErrorMatches, `unrecognized args: \["password"\]`)
33
33
func (s *RemoveUserSuite) TestNotEnoughArgs(c *gc.C) {
34
_, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{})
34
_, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}))
35
35
c.Assert(err, gc.ErrorMatches, `no username supplied`)