filters_test.py 803 Bytes
Newer Older
Romain Bignon's avatar
Romain Bignon committed
1
from assnet.filters import quote_url
2 3 4 5 6 7
from paste.url import URL
from unittest import TestCase


class FiltersTest(TestCase):
    def test_quote(self):
Romain Bignon's avatar
Romain Bignon committed
8 9 10 11
        assert quote_url(URL('http://assnet.org/')) \
                == 'http://assnet.org/'
        assert quote_url(URL('http://assnet.org:42/')) \
                == 'http://assnet.org:42/'
12 13
        assert quote_url(URL('22:42:01.JPG').setvars(view='thumbnail')) \
                == '22%3A42%3A01.JPG?view=thumbnail'
Romain Bignon's avatar
Romain Bignon committed
14 15 16 17
        assert quote_url(URL('http://assnet.org/22:42:01.JPG').setvars(view='thumbnail')) \
                == 'http://assnet.org/22%3A42%3A01.JPG?view=thumbnail'
        assert quote_url(URL('http://assnet.org:42/22:42:01.JPG').setvars(view='thumbnail')) \
                == 'http://assnet.org:42/22%3A42%3A01.JPG?view=thumbnail'