

def test_enqueue_wait_partial_relay(self):
    env = Envelope('sender@example.com', ['rcpt1@example.com', 'rcpt2@example.com', 'rcpt3@example.com'])
    self.store.write(env, IsA(float)).AndReturn('1234')
    self.relay._attempt(env, 0).AndReturn({
        'rcpt1@example.com': None,
        'rcpt2@example.com': TransientRelayError('transient', Reply('450', 'transient')),
        'rcpt3@example.com': PermanentRelayError('permanent', Reply('550', 'permanent')),
    })
    self.store.increment_attempts('1234')
    self.store.set_timestamp('1234', IsA(float))
    self.store.set_recipients_delivered('1234', set([0, 2]))
    self.mox.ReplayAll()

    def backoff(envelope, attempts):
        return 0

    def no_bounce(envelope, reply):
        return None
    queue = Queue(self.store, self.relay, backoff=backoff, bounce_factory=no_bounce, 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/original