mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-15 12:32:18 -05:00
cec4ed573d
Switched out sqlite3 libs in favour of SQLAlchemy v0.9, will gradually migrate dialects and scheme to be fully SQLAlchemy compliant for using there ORM with sessions instead of direct. Fixed getEpisode function to stop making unrequired scene number conversions on already converted data thats available now from cache.
30 lines
1.3 KiB
Python
30 lines
1.3 KiB
Python
"""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()
|