當前位置: 首頁>>代碼示例>>Python>>正文


Python MxSmtpRelay.new_static_relay方法代碼示例

本文整理匯總了Python中slimta.relay.smtp.mx.MxSmtpRelay.new_static_relay方法的典型用法代碼示例。如果您正苦於以下問題:Python MxSmtpRelay.new_static_relay方法的具體用法?Python MxSmtpRelay.new_static_relay怎麽用?Python MxSmtpRelay.new_static_relay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在slimta.relay.smtp.mx.MxSmtpRelay的用法示例。


在下文中一共展示了MxSmtpRelay.new_static_relay方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_attempt_force_mx

# 需要導入模塊: from slimta.relay.smtp.mx import MxSmtpRelay [as 別名]
# 或者: from slimta.relay.smtp.mx.MxSmtpRelay import new_static_relay [as 別名]
 def test_attempt_force_mx(self):
     env = Envelope("[email protected]", ["[email protected]"])
     mx = MxSmtpRelay()
     static = self.mox.CreateMock(StaticSmtpRelay)
     self.mox.StubOutWithMock(mx, "new_static_relay")
     mx.new_static_relay("mail.example.com", 25).AndReturn(static)
     static.attempt(env, 0)
     static.attempt(env, 1)
     self.mox.ReplayAll()
     mx.force_mx("example.com", "mail.example.com")
     mx.attempt(env, 0)
     mx.attempt(env, 1)
開發者ID:rgcarrasqueira,項目名稱:python-slimta,代碼行數:14,代碼來源:test_slimta_relay_smtp_mx.py

示例2: test_attempt_no_mx

# 需要導入模塊: from slimta.relay.smtp.mx import MxSmtpRelay [as 別名]
# 或者: from slimta.relay.smtp.mx.MxSmtpRelay import new_static_relay [as 別名]
 def test_attempt_no_mx(self):
     env = Envelope('[email protected]', ['[email protected]'])
     a_ret = FakeAAnswer(False, [('1.2.3.4', )])
     mx = MxSmtpRelay()
     static = self.mox.CreateMock(StaticSmtpRelay)
     self.mox.StubOutWithMock(mx, 'new_static_relay')
     self.mox.StubOutWithMock(dns.resolver, 'query')
     dns.resolver.query('example.com', 'MX').AndRaise(dns.resolver.NXDOMAIN)
     dns.resolver.query('example.com', 'A').AndReturn(a_ret)
     mx.new_static_relay('1.2.3.4', 25).AndReturn(static)
     static.attempt(env, 0)
     self.mox.ReplayAll()
     mx.attempt(env, 0)
開發者ID:rafaelnovello,項目名稱:python-slimta,代碼行數:15,代碼來源:test_slimta_relay_smtp_mx.py

示例3: test_attempt_no_mx

# 需要導入模塊: from slimta.relay.smtp.mx import MxSmtpRelay [as 別名]
# 或者: from slimta.relay.smtp.mx.MxSmtpRelay import new_static_relay [as 別名]
 def test_attempt_no_mx(self):
     env = Envelope("[email protected]", ["[email protected]"])
     a_ret = FakeAAnswer(False, [("1.2.3.4",)])
     mx = MxSmtpRelay()
     static = self.mox.CreateMock(StaticSmtpRelay)
     self.mox.StubOutWithMock(mx, "new_static_relay")
     self.mox.StubOutWithMock(dns_resolver, "query")
     dns_resolver.query("example.com", "MX").AndRaise(dns.resolver.NXDOMAIN)
     dns_resolver.query("example.com", "A").AndReturn(a_ret)
     mx.new_static_relay("1.2.3.4", 25).AndReturn(static)
     static.attempt(env, 0)
     self.mox.ReplayAll()
     mx.attempt(env, 0)
開發者ID:rgcarrasqueira,項目名稱:python-slimta,代碼行數:15,代碼來源:test_slimta_relay_smtp_mx.py

示例4: test_attempt

# 需要導入模塊: from slimta.relay.smtp.mx import MxSmtpRelay [as 別名]
# 或者: from slimta.relay.smtp.mx.MxSmtpRelay import new_static_relay [as 別名]
 def test_attempt(self):
     env = Envelope("[email protected]", ["[email protected]"])
     mx_ret = FakeMxAnswer(False, [(5, "mx1.example.com"), (10, "mx2.example.com")])
     mx = MxSmtpRelay()
     static = self.mox.CreateMock(StaticSmtpRelay)
     self.mox.StubOutWithMock(mx, "new_static_relay")
     self.mox.StubOutWithMock(dns_resolver, "query")
     dns_resolver.query("example.com", "MX").AndReturn(mx_ret)
     mx.new_static_relay("mx1.example.com", 25).AndReturn(static)
     static.attempt(env, 0)
     mx.new_static_relay("mx2.example.com", 25).AndReturn(static)
     static.attempt(env, 1)
     self.mox.ReplayAll()
     mx.attempt(env, 0)
     mx.attempt(env, 1)
開發者ID:rgcarrasqueira,項目名稱:python-slimta,代碼行數:17,代碼來源:test_slimta_relay_smtp_mx.py

示例5: test_attempt

# 需要導入模塊: from slimta.relay.smtp.mx import MxSmtpRelay [as 別名]
# 或者: from slimta.relay.smtp.mx.MxSmtpRelay import new_static_relay [as 別名]
 def test_attempt(self):
     env = Envelope('[email protected]', ['[email protected]'])
     mx_ret = FakeMxAnswer(False, [(5, 'mx1.example.com'),
                                   (10, 'mx2.example.com')])
     mx = MxSmtpRelay()
     static = self.mox.CreateMock(StaticSmtpRelay)
     self.mox.StubOutWithMock(mx, 'new_static_relay')
     self.mox.StubOutWithMock(dns.resolver, 'query')
     dns.resolver.query('example.com', 'MX').AndReturn(mx_ret)
     mx.new_static_relay('mx1.example.com', 25).AndReturn(static)
     static.attempt(env, 0)
     mx.new_static_relay('mx2.example.com', 25).AndReturn(static)
     static.attempt(env, 1)
     self.mox.ReplayAll()
     mx.attempt(env, 0)
     mx.attempt(env, 1)
開發者ID:RoboticCheese,項目名稱:python-slimta,代碼行數:18,代碼來源:test_slimta_relay_smtp_mx.py


注:本文中的slimta.relay.smtp.mx.MxSmtpRelay.new_static_relay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。