Skip to content
Browse files

user management program tests

  • Loading branch information...
1 parent 25e63e4 commit 0cdb9268bd3e69d221e41ad0599a61f2203a276f BuzzTroll committed Jun 1, 2010
Showing with 28 additions and 0 deletions.
  1. +28 −0 cumulus/tests/client/user_tests.py
View
28 cumulus/tests/client/user_tests.py
@@ -18,6 +18,7 @@
import pycb.tools.add_user
import pycb.tools.list_users
import pycb.tools.remove_user
+import pycb.tools.set_quota
#
class TestAddUsers(unittest.TestCase):
@@ -79,8 +80,35 @@ def test_column_report(self):
rc = self.find_in_file(outFileName, display_name)
self.assertTrue(rc, "display name not found in list")
+ rc = pycb.tools.list_users.main(["-O", outFileName, "-b", "-r", "quota,friendly,quota", display_name])
+ self.assertEqual(rc, 0, "rc = %d" % (rc))
+
+ n = "None,%s,None" % (display_name)
+ rc = self.find_in_file(outFileName, display_name)
+ self.assertTrue(rc, "display name not found in list")
rc = pycb.tools.remove_user.main([display_name])
self.assertEqual(rc, 0, "rc = %d" % (rc))
+ def test_quota(self):
+ display_name = str(uuid.uuid1())
+ rc = pycb.tools.add_user.main([display_name])
+ self.assertEqual(rc, 0, "rc = %d" % (rc))
+
+ (tmpFD, outFileName) = tempfile.mkstemp("cumulustests")
+ os.close(tmpFD)
+
+ q = "1000"
+ rc = pycb.tools.set_quota.main([display_name, q])
+ self.assertEqual(rc, 0, "rc = %d" % (rc))
+
+ rc = pycb.tools.list_users.main(["-O", outFileName, "-b", "-r", "friendly,quota", display_name])
+ self.assertEqual(rc, 0, "rc = %d" % (rc))
+
+ n = "%s,%s" % (display_name, q)
+ rc = self.find_in_file(outFileName, display_name)
+ self.assertTrue(rc, "display name not found in list")
+
+ rc = pycb.tools.remove_user.main([display_name])
+ self.assertEqual(rc, 0, "rc = %d" % (rc))

0 comments on commit 0cdb926

Please sign in to comment.
Something went wrong with that request. Please try again.