From 043ba8fc03c4af65cca5f03faa36df7361db52ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Sat, 4 Jan 2020 19:19:27 +0100 Subject: [PATCH] a unit test for the thing I wrote last time --- tests/test_exceptions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 33c1178..1e84b0e 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -1,6 +1,6 @@ # coding=UTF-8 from __future__ import print_function, absolute_import, division -import six + import unittest from coolamqp.exceptions import AMQPError @@ -13,3 +13,8 @@ class TestExcs(unittest.TestCase): self.assertTrue(u'100' in str(e)) self.assertTrue(u'wtf' in str(e)) self.assertTrue(repr(e).startswith(u'AMQPError')) + + def test_parses_memoryview_correctly(self): + e = AMQPError(100, memoryview(u'wtf'.encode('utf8')), 0, 0) + self.assertIn('wtf', str(e)) + self.assertIn('wtf', repr(e)) -- GitLab