

def test_policies(self):
    p1 = p2.mox.CreateMock(QueuePolicy)
    p2 = self.mox.CreateMock(QueuePolicy)
    p1.apply(self.env)
    p2.apply(self.env)
    self.mox.ReplayAll()
    queue = Queue(self.store, self.relay)
    queue.add_policy(p1)
    queue.add_policy(p2)
    self.assertRaises(TypeError, queue.add_policy, None)
    queue._run_policies(self.env)

dataset/ETHPy150Open slimta/python-slimta/test/test_slimta_queue.py TestQueue.test_policies/VarMisuse@12/14 `self`->`p2`