예제 #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)