예제 #1
0
파일: tests.py 프로젝트: BlauFeuer/evennia
 def test_booleans(self):
     self.assertEquals(True, lockfuncs.true(self.account2, self.obj1))
     self.assertEquals(True, lockfuncs.all(self.account2, self.obj1))
     self.assertEquals(False, lockfuncs.false(self.account2, self.obj1))
     self.assertEquals(False, lockfuncs.none(self.account2, self.obj1))
     self.assertEquals(True, lockfuncs.self(self.obj1, self.obj1))
     self.assertEquals(True, lockfuncs.self(self.account, self.account))
     self.assertEquals(False, lockfuncs.superuser(self.account, None))
예제 #2
0
 def test_booleans(self):
     self.assertEqual(True, lockfuncs.true(self.account2, self.obj1))
     self.assertEqual(True, lockfuncs.all(self.account2, self.obj1))
     self.assertEqual(False, lockfuncs.false(self.account2, self.obj1))
     self.assertEqual(False, lockfuncs.none(self.account2, self.obj1))
     self.assertEqual(True, lockfuncs.self(self.obj1, self.obj1))
     self.assertEqual(True, lockfuncs.self(self.account, self.account))
     self.assertEqual(False, lockfuncs.superuser(self.account, None))
예제 #3
0
파일: tests.py 프로젝트: BlauFeuer/evennia
 def test_quell_perm(self):
     self.account2.db._quell = True
     self.assertEquals(False, lockfuncs.false(self.char2, None))
     self.assertEquals(False, lockfuncs.perm(self.char2, None, 'Developer'))
     self.assertEquals(False, lockfuncs.perm(self.char2, None, 'Developers'))
     self.assertEquals(False, lockfuncs.perm(self.char2, None, 'Admin'))
     self.assertEquals(False, lockfuncs.perm(self.char2, None, 'Admins'))
     self.assertEquals(True, lockfuncs.perm(self.char2, None, 'Player'))
     self.assertEquals(True, lockfuncs.perm(self.char2, None, 'Players'))
     self.assertEquals(True, lockfuncs.perm(self.char2, None, 'Builder'))
     self.assertEquals(True, lockfuncs.perm(self.char2, None, 'Builders'))
예제 #4
0
 def test_quell_perm(self):
     self.account2.db._quell = True
     self.assertEqual(False, lockfuncs.false(self.char2, None))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, 'Developer'))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, 'Developers'))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, 'Admin'))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, 'Admins'))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, 'Player'))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, 'Players'))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, 'Builder'))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, 'Builders'))
예제 #5
0
 def test_quell_perm(self):
     self.account2.db._quell = True
     self.assertEqual(False, lockfuncs.false(self.char2, None))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, "Developer"))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, "Developers"))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, "Admin"))
     self.assertEqual(False, lockfuncs.perm(self.char2, None, "Admins"))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, "Player"))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, "Players"))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, "Builder"))
     self.assertEqual(True, lockfuncs.perm(self.char2, None, "Builders"))
예제 #6
0
파일: tests.py 프로젝트: 325975/evennia
 def testrun(self):
     self.obj2.permissions.add('Wizards')
     self.assertEquals(True, lockfuncs.true(self.obj2, self.obj1))
     self.assertEquals(False, lockfuncs.false(self.obj2, self.obj1))
     self.assertEquals(True, lockfuncs.perm(self.obj2, self.obj1, 'Wizards'))
     self.assertEquals(True, lockfuncs.perm_above(self.obj2, self.obj1, 'Builders'))
     dbref = self.obj2.dbref
     self.assertEquals(True, lockfuncs.dbref(self.obj2, self.obj1, '%s' % dbref))
     self.obj2.db.testattr = 45
     self.assertEquals(True, lockfuncs.attr(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(False, lockfuncs.attr_gt(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(True, lockfuncs.attr_ge(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(False, lockfuncs.attr_lt(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(True, lockfuncs.attr_le(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(False, lockfuncs.attr_ne(self.obj2, self.obj1, 'testattr', '45'))
예제 #7
0
 def testrun(self):
     self.obj2.permissions.add('Admin')
     self.assertEquals(True, lockfuncs.true(self.obj2, self.obj1))
     self.assertEquals(False, lockfuncs.false(self.obj2, self.obj1))
     self.assertEquals(True, lockfuncs.perm(self.obj2, self.obj1, 'Admin'))
     self.assertEquals(
         True, lockfuncs.perm_above(self.obj2, self.obj1, 'Builder'))
     dbref = self.obj2.dbref
     self.assertEquals(True,
                       lockfuncs.dbref(self.obj2, self.obj1, '%s' % dbref))
     self.obj2.db.testattr = 45
     self.assertEquals(
         True, lockfuncs.attr(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(
         False, lockfuncs.attr_gt(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(
         True, lockfuncs.attr_ge(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(
         False, lockfuncs.attr_lt(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(
         True, lockfuncs.attr_le(self.obj2, self.obj1, 'testattr', '45'))
     self.assertEquals(
         False, lockfuncs.attr_ne(self.obj2, self.obj1, 'testattr', '45'))