mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Porting zerobin to python 3
This commit is contained in:
29
libs/cherrypy/test/test_httplib.py
Normal file
29
libs/cherrypy/test/test_httplib.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Tests for cherrypy/lib/httputil.py."""
|
||||
|
||||
import unittest
|
||||
from cherrypy.lib import httputil
|
||||
|
||||
|
||||
class UtilityTests(unittest.TestCase):
|
||||
|
||||
def test_urljoin(self):
|
||||
# Test all slash+atom combinations for SCRIPT_NAME and PATH_INFO
|
||||
self.assertEqual(httputil.urljoin("/sn/", "/pi/"), "/sn/pi/")
|
||||
self.assertEqual(httputil.urljoin("/sn/", "/pi"), "/sn/pi")
|
||||
self.assertEqual(httputil.urljoin("/sn/", "/"), "/sn/")
|
||||
self.assertEqual(httputil.urljoin("/sn/", ""), "/sn/")
|
||||
self.assertEqual(httputil.urljoin("/sn", "/pi/"), "/sn/pi/")
|
||||
self.assertEqual(httputil.urljoin("/sn", "/pi"), "/sn/pi")
|
||||
self.assertEqual(httputil.urljoin("/sn", "/"), "/sn/")
|
||||
self.assertEqual(httputil.urljoin("/sn", ""), "/sn")
|
||||
self.assertEqual(httputil.urljoin("/", "/pi/"), "/pi/")
|
||||
self.assertEqual(httputil.urljoin("/", "/pi"), "/pi")
|
||||
self.assertEqual(httputil.urljoin("/", "/"), "/")
|
||||
self.assertEqual(httputil.urljoin("/", ""), "/")
|
||||
self.assertEqual(httputil.urljoin("", "/pi/"), "/pi/")
|
||||
self.assertEqual(httputil.urljoin("", "/pi"), "/pi")
|
||||
self.assertEqual(httputil.urljoin("", "/"), "/")
|
||||
self.assertEqual(httputil.urljoin("", ""), "/")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user