def test_onto_transport(self): """How the request is sent by transmitting across a mock Transport""" # use a real transport, but intercept at the http/xml layer transport = InstrumentedXMLRPCTransport(self, expect_auth=True) service = LaunchpadService(transport) service.registrant_email = '*****@*****.**' service.registrant_password = '******' rego = BranchRegistrationRequest('http://test-server.com/bzr/branch', 'branch-id', 'my test branch', 'description', '*****@*****.**', 'product') rego.submit(service) self.assertEquals(transport.connected_host, 'xmlrpc.launchpad.net') self.assertEquals(len(transport.sent_params), 6) self.assertEquals(transport.sent_params, ('http://test-server.com/bzr/branch', # branch_url 'branch-id', # branch_name 'my test branch', # branch_title 'description', '*****@*****.**', 'product')) self.assertTrue(transport.got_request)
def test_gather_user_credentials_has_password(self): service = LaunchpadService() service.registrant_password = '******' # This should be a basic no-op, since we already have the password service.gather_user_credentials() self.assertEqual('mypassword', service.registrant_password)