def test_that_start_calls_setup_smtp_gateway(self, gateway_mock): smtp = LeapSmtp(self.provider, self.auth, self.keymanager) port = 500 smtp.local_smtp_port_number = port gateway_mock.return_value = (None, None) with HTTMock(ca_cert_mock, not_found_mock): smtp.ensure_running() cert_path = self._client_cert_path() gateway_mock.assert_called_with(keymanager=self.keymanager, smtp_cert=cert_path, smtp_key=cert_path, userid='*****@*****.**', smtp_port='1234', encrypted_only=False, smtp_host='smtp.some-sever.test', port=port)