Пример #1
0
    def test_quote_plus_unicode_unichar(self):
        """
        Test if unicode characters are quoted correctly
        """
        s = u'\u9b54\u11b3\uaf92\u1111'

        encoded = quote_plus_unicode(s)

        self.assertEqual(s, unquote_plus(encoded))
Пример #2
0
    def test_quote_plus_unicode_char(self):
        """
        Test if a ASCII characters are quoted correctly
        """
        s = u'Ab09'

        encoded = quote_plus_unicode(s)

        self.assertEqual(s, unquote_plus(encoded))
Пример #3
0
def test_quote_plus_unicode_unichar():
    """
    Test if unicode characters are quoted correctly
    """
    s = '\u9b54\u11b3\uaf92\u1111'

    encoded = quote_plus_unicode(s)

    assert s == unquote_plus(encoded)
Пример #4
0
def test_quote_plus_unicode_char():
    """
    Test if a ASCII characters are quoted correctly
    """
    s = 'Ab09'

    encoded = quote_plus_unicode(s)

    assert s == unquote_plus(encoded)
Пример #5
0
    def test_quote_plus_unicode_compound(self):
        """
        Test if a jumble of unicode, reserved and normal chars are quoted correctly
        """
        s = u'\u9b54\u11b3+ A5&\uaf92\u1111'

        encoded = quote_plus_unicode(s)

        self.assertNotEqual(s, encoded)
        self.assertEqual(s, unquote_plus(encoded))
Пример #6
0
    def test_quote_plus_unicode_reserved(self):
        """
        Test if a URI reserved characters are quoted correctly
        """
        s = u'+ &'

        encoded = quote_plus_unicode(s)

        self.assertNotEqual(s, encoded)
        self.assertEqual(s, unquote_plus(encoded))
Пример #7
0
def test_quote_plus_unicode_compound():
    """
    Test if a jumble of unicode, reserved and normal chars are quoted correctly
    """
    s = '\u9b54\u11b3+ A5&\uaf92\u1111'

    encoded = quote_plus_unicode(s)

    assert s != encoded
    assert s == unquote_plus(encoded)
Пример #8
0
def test_quote_plus_unicode_reserved():
    """
    Test if a URI reserved characters are quoted correctly
    """
    s = '+ &'

    encoded = quote_plus_unicode(s)

    assert s != encoded
    assert s == unquote_plus(encoded)