예제 #1
0
def html_encode(path):
    """Return an HTML encoded Path.

    :param path: ``str``
    :return: ``str``
    """
    if sys.version_info > (3, 2, 0):
        return urllib.parse.quote(utils.ensure_string(path))
    else:
        return urllib.quote(utils.ensure_string(path))
예제 #2
0
파일: http.py 프로젝트: cloudnull/cloudlib
def html_encode(path):
    """Return an HTML encoded Path.

    :param path: ``str``
    :return: ``str``
    """
    if sys.version_info > (3, 2, 0):
        return urllib.parse.quote(utils.ensure_string(path))
    else:
        return urllib.quote(utils.ensure_string(path))
예제 #3
0
 def test_ensure_string_str(self):
     self.assertTrue(isinstance(utils.ensure_string(obj='test'), str))
예제 #4
0
 def test_ensure_string_str(self):
     self.assertTrue(isinstance(utils.ensure_string(obj='test'), str))