示例#1
0
 def test_exception(self):
     exc = AMQPError('error', 7, 'My Error', (10, 10))
     self.assertEqual(exc.amqp_reply_code, 7)
     self.assertEqual(exc.amqp_reply_text, 'My Error')
     self.assertEqual(exc.amqp_method_sig, (10, 10))
     self.assertEqual(exc.args, ('error', 7, 'My Error',
                                 (10, 10), 'Connection.start'))
示例#2
0
 def test_exception(self):
     exc = AMQPError('My Error', spec.Connection.Start, reply_code=7)
     self.assertEqual(exc.reply_code, 7)
     self.assertEqual(exc.reply_text, 'My Error')
     self.assertEqual(exc.method_sig, spec.Connection.Start),
     self.assertEqual(
         exc.args,
         (7, 'My Error', spec.Connection.Start, 'Connection.start'),
     )
 def test_str(self):
     self.assertTrue(str(AMQPError()))
     x = AMQPError(method_sig=(50, 60))
     self.assertTrue(str(x))
示例#4
0
 def test_str(self):
     assert str(AMQPError()) == '<AMQPError: unknown error>'
     x = AMQPError(method_sig=(50, 60))
     assert str(x) == '(50, 60): (0) None'
     x = AMQPError('Test Exception')
     assert str(x) == 'Test Exception'
示例#5
0
 def test_str(self):
     assert str(AMQPError())
     x = AMQPError(method_sig=(50, 60))
     assert str(x)