Decode gearman function into utf

Previously the test was trying to cast the binary string into a string
which in python3 still returns a binary string. As such the following
startswith would not match as it was doing
b'merger:cat'.startswith('merger:').

Fix the test by decoding into UTF-8

Change-Id: I794af9f88dcdf0b697249a8e372ad08d6b154315
This commit is contained in:
Joshua Hesketh 2018-03-14 22:52:28 +11:00
parent f0f68098fe
commit e508880579
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ class TestScheduler(ZuulTestCase):
"Test the correct variant of a job runs on a branch"
self._startMerger()
for f in list(self.executor_server.merger_worker.functions.keys()):
f = str(f)
f = f.decode('utf8')
if f.startswith('merger:'):
self.executor_server.merger_worker.unRegisterFunction(f)