mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 08:21:30 +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
|
raise last_exception
|
||||||
bugs = set()
|
bugs = set()
|
||||||
for l in changes:
|
for l in changes:
|
||||||
|
l = l.decode('utf-8')
|
||||||
if l.startswith('Launchpad-Bugs-Fixed: '):
|
if l.startswith('Launchpad-Bugs-Fixed: '):
|
||||||
bugs = {int(b) for b in l.split()[1:]}
|
bugs = {int(b) for b in l.split()[1:]}
|
||||||
break
|
break
|
||||||
|
@ -22,7 +22,7 @@ from britney2.policies.sruadtregression import SRUADTRegressionPolicy
|
|||||||
from tests.test_sourceppa import FakeBritney
|
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
|
Date: Mon, 16 Jul 2018 17:05:18 -0500
|
||||||
Source: test
|
Source: test
|
||||||
Binary: test
|
Binary: test
|
||||||
@ -96,7 +96,7 @@ class T(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
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):
|
def test_bugs_from_changes(self, urlopen_mock):
|
||||||
"""Check extraction of bug numbers from .changes files"""
|
"""Check extraction of bug numbers from .changes files"""
|
||||||
with TemporaryDirectory() as tmpdir:
|
with TemporaryDirectory() as tmpdir:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user