示例#1
0
    def test_quote_plus(self):
        """
        Plus version testing of the quoting operation, this test is
        analogous to the previous test.
        """

        result = colony.quote_plus("Hello World")
        self.assertEqual(result, "Hello+World")

        result = colony.quote_plus("Olá Mundo")
        self.assertEqual(result, "Ol%C3%A1+Mundo")

        result = colony.quote_plus("你好世界")
        self.assertEqual(result, "%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C")
示例#2
0
    def test_quote_plus(self):
        """
        Plus version testing of the quoting operation, this test is
        analogous to the previous test.
        """

        result = colony.quote_plus("Hello World")
        self.assertEqual(result, "Hello+World")

        result = colony.quote_plus("Olá Mundo")
        self.assertEqual(result, "Ol%C3%A1+Mundo")

        result = colony.quote_plus("你好世界")
        self.assertEqual(result, "%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C")
示例#3
0
    def _escape_url(self, url_text):
        """
        Escapes the given url text into a valid http get request string.

        @rtype: String
        @return: the given url text in a valid http get request string.
        """

        # returns the quoted version of the url text
        return colony.quote_plus(str(url_text), "")
示例#4
0
    def _escape_url(self, url_text):
        """
        Escapes the given URL text into a valid HTTP get request string.

        :rtype: String
        :return: the given URL text in a valid HTTP get request string.
        """

        # returns the quoted version of the URL text
        return colony.quote_plus(str(url_text), "")