mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-13 20:31:12 +00:00
SRU ADT regression: Need to decode the returned bytes from urlopen()
This commit is contained in:
parent
73dabf2136
commit
c8492d4cc7
@ -58,6 +58,7 @@ class SRUADTRegressionPolicy(BasePolicy, Rest):
|
||||
raise last_exception
|
||||
bugs = set()
|
||||
for l in changes:
|
||||
l = l.decode('utf-8')
|
||||
if l.startswith('Launchpad-Bugs-Fixed: '):
|
||||
bugs = {int(b) for b in l.split()[1:]}
|
||||
break
|
||||
|
@ -22,7 +22,7 @@ from britney2.policies.sruadtregression import SRUADTRegressionPolicy
|
||||
from tests.test_sourceppa import FakeBritney
|
||||
|
||||
|
||||
FAKE_CHANGES = """Format: 1.8
|
||||
FAKE_CHANGES = b"""Format: 1.8
|
||||
Date: Mon, 16 Jul 2018 17:05:18 -0500
|
||||
Source: test
|
||||
Binary: test
|
||||
@ -96,7 +96,7 @@ class T(unittest.TestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
@patch('britney2.policies.sruadtregression.urlopen', return_value=iter(FAKE_CHANGES.split('\n')))
|
||||
@patch('britney2.policies.sruadtregression.urlopen', return_value=iter(FAKE_CHANGES.split(b'\n')))
|
||||
def test_bugs_from_changes(self, urlopen_mock):
|
||||
"""Check extraction of bug numbers from .changes files"""
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
|
Loading…
x
Reference in New Issue
Block a user