本文整理汇总了Python中slimta.smtp.reply.Reply类的典型用法代码示例。如果您正苦于以下问题:Python Reply类的具体用法?Python Reply怎么用?Python Reply使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Reply类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_message_set_clear_esc
def test_message_set_clear_esc(self):
r = Reply('250', '2.3.4 Ok')
self.assertEqual('2.3.4 Ok', r.message)
self.assertEqual('2.3.4', r.enhanced_status_code)
r.message = None
self.assertEqual(None, r.message)
self.assertEqual('2.0.0', r.enhanced_status_code)
示例2: test_esc_set_false
def test_esc_set_false(self):
r = Reply('250', 'Ok')
self.assertEqual('2.0.0 Ok', r.message)
r.enhanced_status_code = None
self.assertEqual('2.0.0 Ok', r.message)
r.enhanced_status_code = False
self.assertEqual('Ok', r.message)
示例3: test_copy
def test_copy(self):
r1 = Reply('250', '2.1.0 Ok')
r2 = Reply(command='RCPT')
r2.copy(r1)
self.assertEqual('250', r2.code)
self.assertEqual('2.1.0', r2.enhanced_status_code)
self.assertEqual('2.1.0 Ok', r2.message)
self.assertEqual('RCPT', r2.command)
示例4: test_message_set_with_esc
def test_message_set_with_esc(self):
r = Reply('250')
r.message = '2.3.4 Ok'
self.assertEqual('2.3.4 Ok', r.message)
self.assertEqual('2.3.4', r.enhanced_status_code)
示例5: test_message_set
def test_message_set(self):
r = Reply()
r.message = None
self.assertEqual(None, r.message)
r.message = 'Ok'
self.assertEqual('Ok', r.message)
示例6: test_esc_set_bad_value
def test_esc_set_bad_value(self):
r = Reply()
with self.assertRaises(ValueError):
r.enhanced_status_code = 'abc'
示例7: test_esc_without_code
def test_esc_without_code(self):
r = Reply()
r.enhanced_status_code = '2.3.4'
self.assertEqual(None, r.enhanced_status_code)
r.code = '250'
self.assertEqual('2.3.4', r.enhanced_status_code)
示例8: test_esc_set
def test_esc_set(self):
r = Reply('250')
r.enhanced_status_code = None
self.assertEqual('2.0.0', r.enhanced_status_code)
r.enhanced_status_code = '2.3.4'
self.assertEqual('2.3.4', r.enhanced_status_code)
示例9: test_code_set_bad_value
def test_code_set_bad_value(self):
r = Reply()
with self.assertRaises(ValueError):
r.code = 'asdf'
示例10: test_code_set
def test_code_set(self):
r = Reply()
r.code = None
self.assertEqual(None, r.code)
r.code = '100'
self.assertEqual('100', r.code)
示例11: test_send_newline_first
def test_send_newline_first(self):
r = Reply('250', 'Ok')
r.newline_first = True
io = IO(None)
r.send(io)
self.assertEqual(b'\r\n250 2.0.0 Ok\r\n', io.send_buffer.getvalue())
示例12: test_send
def test_send(self):
r = Reply('250', 'Ok')
io = IO(None)
r.send(io)
self.assertEqual(b'250 2.0.0 Ok\r\n', io.send_buffer.getvalue())
示例13: test_message_set
def test_message_set(self):
r = Reply()
r.message = None
assert_equal(None, r.message)
r.message = 'Ok'
assert_equal('Ok', r.message)
示例14: test_code_set
def test_code_set(self):
r = Reply()
r.code = None
assert_equal(None, r.code)
r.code = '100'
assert_equal('100', r.code)