

def test_enqueue_wait_partial_relay_expired(self):
    env = Envelope('sender@example.com', ['rcpt1@example.com', 'rcpt2@example.com', 'rcpt3@example.com'])
    bounce_mock = self.mox.CreateMockAnything()
    bounce_mock(IsA(Envelope), IsA(Reply)).AndReturn(None)
    bounce_mock(IsA(Envelope), IsA(Reply)).AndReturn(None)
    self.store.write(env, IsA(float)).AndReturn('1234')
    self.relay._attempt(env, 0).AndReturn({
        'rcpt1@example.com': TransientRelayError('transient', Reply('450', 'transient 1')),
        'rcpt2@example.com': TransientRelayError('transient', Reply('450', 'transient 1')),
        'rcpt3@example.com': TransientRelayError('transient', Reply('450', 'transient 2')),
    })
    self.store.increment_attempts('1234')
    self.store.remove('1234')
    self.mox.ReplayAll()
    queue = Queue(self.store, self.relay, bounce_factory=bounce_mock, relay_pool=5)
    queue.enqueue(env)
    queue.relay_pool.join()

dataset/ETHPy150Open slimta/python-slimta/test/test_slimta_queue.py TestQueue.test_enqueue_wait_partial_relay_expired/original