def testSetCmd(self): user = User(_admin_sender) user.makeAdmin() Command.dispatch(self.admin_msg) self.assertEqual(user.getAdminVariable(_var), _val)
def testSetCmd(self): Command.dispatch(self.user_msg) user = User(_user_sender) val = user.getVariable(_var) self.assertEqual(val, None)
def setUp(self): self.user = User("*****@*****.**")
def testSetCmd(self): user = User(_admin_sender) user.makeAdmin() Command.dispatch(self.admin_msg)
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)