~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to lp_registration.py

  • Committer: Martin Pool
  • Date: 2006-03-16 17:33:06 UTC
  • mto: (1668.1.8 bzr-0.8.mbp)
  • mto: This revision was merged to the branch mainline in revision 1710.
  • Revision ID: mbp@sourcefrog.net-20060316173306-77f984ea48977325
Don't transmit non-standard xmlrpc <nil> value.

Factor out unneeded tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    def __init__(self, branch_url, branch_id):
36
36
        self.branch_url = branch_url
37
37
        self.branch_id = branch_id
38
 
        self.branch_description = None
39
 
        self.owner_email = None
 
38
        self.branch_description = ''
 
39
        self.owner_email = ''
40
40
        self.service_url = self.DEFAULT_SERVICE_URL
41
41
        self.registrant = 'testuser@launchpad.net'
42
42
        self.password = 'testpassword'
43
43
 
44
 
    def _request_xml(self):
45
 
        """Return the string form of the xmlrpc request."""
46
 
        return xmlrpclib.dumps(self._request_params(),
47
 
                               methodname=self._methodname,
48
 
                               allow_none=True)
49
 
 
50
44
    def _request_params(self):
51
45
        """Return xmlrpc request parameters"""
52
46
        # This must match the parameter tuple expected by Launchpad for this
74
68
                                 quote(self.password),
75
69
                                 hostinfo)
76
70
        url = urlunsplit((scheme, hostinfo, path, '', ''))
77
 
        proxy = xmlrpclib.ServerProxy(url, allow_none=True,
78
 
                                      transport=transport)
 
71
        proxy = xmlrpclib.ServerProxy(url, transport=transport)
79
72
        proxy.register_branch(*self._request_params())
80
73