From 26e5bde31d6ef01455393c353e4cc3d6e39316f1 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 17 Jun 2016 13:21:00 +0200 Subject: [PATCH] fix tests for python 3 compatiblity Signed-off-by: Heiko Thiery --- tests/interfaces/test_ipmitool.py | 6 +++--- tests/test_utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/interfaces/test_ipmitool.py b/tests/interfaces/test_ipmitool.py index e2a8e79e..5d27d6c5 100644 --- a/tests/interfaces/test_ipmitool.py +++ b/tests/interfaces/test_ipmitool.py @@ -64,7 +64,7 @@ def test_send_and_receive_raw_return_value(self): target = Target(0x20) data = self._interface.send_and_receive_raw(target, 0, 0x6, '\x01') - eq_(data, '\x00\x10\x80\x01\x02\x51\xbd\x98\x3a\x00\xa8\x06\x00\x03\x00\x00') + eq_(data, b'\x00\x10\x80\x01\x02\x51\xbd\x98\x3a\x00\xa8\x06\x00\x03\x00\x00') def test_send_and_receive_raw_completion_code_timeout(self): mock = MagicMock() @@ -74,7 +74,7 @@ def test_send_and_receive_raw_completion_code_timeout(self): self._interface._run_ipmitool = mock data = self._interface.send_and_receive_raw(target, 0, 0x6, '\x01') - eq_(data, '\xc3') + eq_(data, b'\xc3') def test_send_and_receive_raw_completion_code_not_ok(self): mock = MagicMock() @@ -84,7 +84,7 @@ def test_send_and_receive_raw_completion_code_not_ok(self): self._interface._run_ipmitool = mock data = self._interface.send_and_receive_raw(target, 0, 0x6, '\x01') - eq_(data, '\xcc') + eq_(data, b'\xcc') @raises(TimeoutError) def test_send_and_receive_raw_timeout_without_response(self): diff --git a/tests/test_utils.py b/tests/test_utils.py index c328f71f..276a6465 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -51,11 +51,11 @@ def test_bytebuffer_push_string(): eq_(b.tostring(), '0123') b = ByteBuffer() - b.push_string('\x00\xb4') + b.push_string( b'\x00\xb4') eq_(b.tostring(), '\x00\xb4') def test_bytebuffer_pop_string(): - b = ByteBuffer('\x30\x31\x32\x33') + b = ByteBuffer( b'\x30\x31\x32\x33') eq_(b.pop_string(2), '01') eq_(b.tostring(), '23')