Merge lp:~jelmer/brz/launchpad-test-fix into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/launchpad-test-fix
Merge into: lp:brz
Diff against target: 59 lines (+20/-4)
2 files modified
breezy/plugins/launchpad/test_register.py (+19/-4)
python3.passing (+1/-0)
To merge this branch: bzr merge lp:~jelmer/brz/launchpad-test-fix
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+353687@code.launchpad.net

Description of the change

Fix Launchpad registration test on Python 3.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

I feel like this requires a bit of an explanation on the branch over versions, but fair enough.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/launchpad/test_register.py'
2--- breezy/plugins/launchpad/test_register.py 2018-06-27 21:56:53 +0000
3+++ breezy/plugins/launchpad/test_register.py 2018-08-24 01:48:23 +0000
4@@ -28,6 +28,7 @@
5 Transport,
6 )
7
8+from ...sixish import PY3
9 from ...tests import TestCaseWithTransport
10
11 # local import
12@@ -98,6 +99,7 @@
13
14 # Python 2.5's xmlrpclib looks for this.
15 _use_datetime = False
16+ _use_builtin_types = False
17
18 def __init__(self, testcase):
19 self.testcase = testcase
20@@ -111,10 +113,23 @@
21 raise AssertionError()
22 return InstrumentedXMLRPCConnection(test)
23
24- def send_request(self, connection, handler_path, request_body,
25- verbose=None):
26- test = self.testcase
27- self.got_request = True
28+ if PY3:
29+ def send_request(self, host, handler_path, request_body,
30+ verbose=None):
31+ self.connected_host = host
32+ test = self.testcase
33+ self.got_request = True
34+ unpacked, method = xmlrpc_loads(request_body)
35+ if None in unpacked:
36+ raise AssertionError(
37+ "xmlrpc result %r shouldn't contain None" % (unpacked,))
38+ self.sent_params = unpacked
39+ return InstrumentedXMLRPCConnection(test)
40+ else:
41+ def send_request(self, connection, handler_path, request_body,
42+ verbose=None):
43+ test = self.testcase
44+ self.got_request = True
45
46 def send_host(self, conn, host):
47 pass
48
49=== modified file 'python3.passing'
50--- python3.passing 2018-08-23 10:19:35 +0000
51+++ python3.passing 2018-08-24 01:48:23 +0000
52@@ -1236,6 +1236,7 @@
53 breezy.plugins.launchpad.test_lp_service.TestURLInference.test_staging_branch_url
54 breezy.plugins.launchpad.test_lp_service.TestURLInference.test_staging_url
55 breezy.plugins.launchpad.test_register.TestResolveLaunchpadPathRequest.test_mock_resolve_lp_url
56+breezy.plugins.launchpad.test_register.TestResolveLaunchpadPathRequest.test_onto_transport
57 breezy.plugins.launchpad.test_register.TestResolveLaunchpadPathRequest.test_subclass_request
58 breezy.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCSNoNetrc.test_home_netrc_does_not_exist
59 breezy.plugins.netrc_credential_store.tests.test_netrc.TestNetrcCS.test_default_password

Subscribers

People subscribed via source and target branches