示例#1
0
    def _base_uri(scheme, host, port):
        """Return the base URI to use for API requests. Set ``port`` to None
        when creating a UNIX Socket URL.

        :param str scheme: The scheme to use (Default: http)
        :param str host: The host name to connect to (Default: localhost)
        :param int|None port: The port to connect on (Default: 8500)
        :rtype: str

        """
        if port:
            return '{0}://{1}:{2}/{3}'.format(scheme, host, port, VERSION)
        return '{0}://{1}/{2}'.format(scheme, utils.quote(host, ''), VERSION)
示例#2
0
 def urlencode_test(self):
     self.assertEqual("%2Ffoo%40bar", utils.quote("/foo@bar", ""))
示例#3
0
 def urlencode_test(self):
     self.assertEqual("%2Ffoo%40bar", utils.quote("/foo@bar", ""))