Skip to content

Commit

Permalink
fix tests for python 3 compatiblity
Browse files Browse the repository at this point in the history
Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
  • Loading branch information
hthiery committed Jun 17, 2016
1 parent 41b55b5 commit 26e5bde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/interfaces/test_ipmitool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 26e5bde

Please sign in to comment.