From 63ce440979a5484b48a7b1484a685027b12ac41b Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Thu, 10 Sep 2015 12:54:23 +0000 Subject: [PATCH] Correct test_list_meters_meter_id to work with py3 We need to deal with byte strings effectively for this test to work in python3 (while continuing to work in python2). Change-Id: I2165c586ef039f86283d4c93ee5916661b29f40a Closes-Bug: #1494313 --- .../tests/functional/api/v2/test_list_meters_scenarios.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceilometer/tests/functional/api/v2/test_list_meters_scenarios.py b/ceilometer/tests/functional/api/v2/test_list_meters_scenarios.py index 8e656298..9862b60a 100644 --- a/ceilometer/tests/functional/api/v2/test_list_meters_scenarios.py +++ b/ceilometer/tests/functional/api/v2/test_list_meters_scenarios.py @@ -791,5 +791,5 @@ class TestListMeters(v2.FunctionalTest, self.assertEqual(expected, i['meter_id']) self.assertFalse(i['meter_id'].endswith('\n')) self.assertEqual( - [i['resource_id'].encode('utf-8'), i['name'].encode('utf-8')], - base64.b64decode(i['meter_id']).split('+')) + [i['resource_id'], i['name']], + base64.b64decode(i['meter_id']).decode('utf-8').split('+'))