chiark / gitweb /
add "users" command
[disorder] / tests / user.py
index 8c1323282f75c995cb007834e2df961d3ba7669e..345fdef41a829b850bfe760727653018a31523c8 100755 (executable)
@@ -27,9 +27,16 @@ def test():
     print " checking user creation"
     c = disorder.client()
     c.adduser("bob", "bobpass")
+    users = c.users()
+    assert dtest.lists_have_same_contents(users,
+                                          ["fred", "bob", "root"])
     print " checking new user can log in"
     c = disorder.client(user="bob", password="bobpass")
     c.version()
+    print " checking bob can set their email address"
+    c.edituser("bob", "email", "foo@bar")
+    email = c.userinfo("bob", "email")
+    assert email == "foo@bar", "checking bob's email address"
     print " checking user deletion"
     c = disorder.client()
     c.deluser("bob")
@@ -42,6 +49,10 @@ def test():
     except disorder.operationError:
       pass                              # good
     print " deleted user could no longer log in."
+    c = disorder.client()
+    users = c.users()
+    assert dtest.lists_have_same_contents(users,
+                                          ["fred", "root"])
 
 if __name__ == '__main__':
     dtest.run()