From 763ca2a996bf2dce2610668ee2b53e6b5a8e6ee7 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 11 Nov 2015 23:59:21 -0800 Subject: [PATCH] pybind/test_rbd: convert a few more str to bytes for py3 Signed-off-by: Josh Durgin --- src/test/pybind/test_rbd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 3538c12add710..968bd5f499063 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -695,9 +695,9 @@ class TestImage(object): def test_diff_iterate(self): check_diff(self.image, 0, IMG_SIZE, None, []) - self.image.write('a' * 256, 0) + self.image.write(b'a' * 256, 0) check_diff(self.image, 0, IMG_SIZE, None, [(0, 256, True)]) - self.image.write('b' * 256, 256) + self.image.write(b'b' * 256, 256) check_diff(self.image, 0, IMG_SIZE, None, [(0, 512, True)]) self.image.discard(128, 256) check_diff(self.image, 0, IMG_SIZE, None, [(0, 512, True)]) @@ -844,7 +844,7 @@ class TestClone(object): eq(child_data, parent_data[:128] + (b'\0' * 128)) self.clone.resize(IMG_SIZE // 2 + 1) child_data = self.clone.read(IMG_SIZE // 2, 1) - eq(child_data, parent_data[0]) + eq(child_data, parent_data[0:1]) self.clone.resize(0) self.clone.resize(IMG_SIZE) child_data = self.clone.read(IMG_SIZE // 2, 256) @@ -1024,7 +1024,7 @@ class TestExclusiveLock(object): def test_ownership(self): with Image(ioctx, image_name) as image1, Image(ioctx2, image_name) as image2: - image1.write('0'*256, 0) + image1.write(b'0'*256, 0) eq(image1.is_exclusive_lock_owner(), True) eq(image2.is_exclusive_lock_owner(), False) @@ -1107,7 +1107,7 @@ class TestExclusiveLock(object): eq(image1.is_exclusive_lock_owner(), False) eq(image2.is_exclusive_lock_owner(), True) read = image2.read(0, 256) - eq(256*'\0', read) + eq(256 * b'\0', read) def test_follower_write(self): with Image(ioctx, image_name) as image1, Image(ioctx2, image_name) as image2: -- 2.39.5