示例#1
0
 def testSetCmd(self):
     user = User(_admin_sender)
     user.makeAdmin()
     Command.dispatch(self.admin_msg)
     self.assertEqual(user.getAdminVariable(_var), _val)
示例#2
0
 def testSetCmd(self):
     Command.dispatch(self.user_msg)
     user = User(_user_sender)
     val = user.getVariable(_var)
     self.assertEqual(val, None)
示例#3
0
 def setUp(self):
     self.user = User("*****@*****.**")
示例#4
0
 def testSetCmd(self):
     user = User(_admin_sender)
     user.makeAdmin()
     Command.dispatch(self.admin_msg)
示例#5
0
class TestUser(TestCase):

    def setUp(self):
        self.user = User("*****@*****.**")

    def tearDown(self):
        self.user.delete()

    def testNonAdmin(self):
        self.assertEqual(self.user.isAdmin(), False)

    def testMakeAdmin(self):
        self.user.makeAdmin()
        self.assertEqual(self.user.isAdmin(), True)

    def testUserVariable(self):
        var = "plop"
        val = "foo"
        self.user.setVariable(var, val)
        self.assertEqual(self.user.getVariable(var), val)
        self.user.deleteVariable(var)
        self.assertEqual(self.user.getVariable(var), None)