示例#1
0
文件: test_acl.py 项目: czh513/atr
 def test_is_acl_allowed_returns_true(self):
     self.assertTrue(is_acl_allowed("bob", {"engineering_ops"}))
     self.assertTrue(is_acl_allowed("alice", {"engineering_ops"}))
     self.assertTrue(is_acl_allowed("eve", {"engineering_devs"}))
     self.assertTrue(
         is_acl_allowed("eve", {"engineering_ops", "engineering_devs"}))
     self.assertTrue(
         is_acl_allowed("alice", {"engineering_ops", "engineering_devs"}))
示例#2
0
 def message_is_allowed(self, message, acl):
     nick = self.get_user_from_message(message)['nick']
     return is_acl_allowed(nick, acl)
示例#3
0
 def test_is_acl_allowed_returns_false(self):
     self.assertFalse(is_acl_allowed("eve", {"engineering_ops"}))
     self.assertFalse(is_acl_allowed("bob", {"engineering_devs"}))
     self.assertFalse(is_acl_allowed("alice", {"engineering_devs"}))
     self.assertFalse(is_acl_allowed("bob", {"empty_acl"}))
示例#4
0
文件: test_acl.py 项目: CodeMonk/will
 def test_is_acl_allowed_returns_false(self):
     self.assertFalse(is_acl_allowed("eve", {"engineering_ops"}))
     self.assertFalse(is_acl_allowed("bob", {"engineering_devs"}))
     self.assertFalse(is_acl_allowed("alice", {"engineering_devs"}))
     self.assertFalse(is_acl_allowed("bob", {"empty_acl"}))
示例#5
0
文件: test_acl.py 项目: CodeMonk/will
 def test_is_acl_allowed_returns_true(self):
     self.assertTrue(is_acl_allowed("bob", {"engineering_ops"}))
     self.assertTrue(is_acl_allowed("alice", {"engineering_ops"}))
     self.assertTrue(is_acl_allowed("eve", {"engineering_devs"}))
     self.assertTrue(is_acl_allowed("eve", {"engineering_ops", "engineering_devs"}))
     self.assertTrue(is_acl_allowed("alice", {"engineering_ops", "engineering_devs"}))
示例#6
0
def test_is_acl_allowed_returns_false(not_allowed_message_with_acls):
    message, acls = not_allowed_message_with_acls
    assert not is_acl_allowed(message.sender.id, acls)
示例#7
0
def test_is_acl_allowed_returns_true(allowed_message_with_acls):
    message, acls = allowed_message_with_acls
    assert is_acl_allowed(message.sender.id, acls)