예제 #1
0
def test_parse_urls_without_image():

    options = Url.parse_options(
        'unsafe/meta/10x11:12x13/-300x-200/left/top/smart/')

    assert options

    options = Url.parse_options(
        '/unsafe/meta/10x11:12x13/-300x-200/left/top/smart/')

    assert options
    assert options['meta'] == True

    assert options['crop']['left'] == 10
    assert options['crop']['top'] == 11
    assert options['crop']['right'] == 12
    assert options['crop']['bottom'] == 13

    assert options['width'] == 300
    assert options['height'] == 200

    assert options['horizontal_flip'] == True
    assert options['vertical_flip'] == True

    assert options['halign'] == 'left'
    assert options['valign'] == 'top'

    assert options['smart'] == True
예제 #2
0
def test_parse_urls_without_image():

    options = Url.parse_options("unsafe/meta/10x11:12x13/-300x-200/left/top/smart/")

    assert options

    options = Url.parse_options("/unsafe/meta/10x11:12x13/-300x-200/left/top/smart/")

    assert options
    assert options['meta'] == True

    assert options['crop']['left'] == 10
    assert options['crop']['top'] == 11
    assert options['crop']['right'] == 12
    assert options['crop']['bottom'] == 13

    assert options['width'] == 300
    assert options['height'] == 200

    assert options['horizontal_flip'] == True
    assert options['vertical_flip'] == True

    assert options['halign'] == 'left'
    assert options['valign'] == 'top'

    assert options['smart'] == True
예제 #3
0
파일: url_vows.py 프로젝트: cezarsa/thumbor
 def topic(self):
     return Url.parse_options('/unsafe/meta/10x11:12x13/fit-in/-300x-200/left/top/smart/filters:some_filter()/')
예제 #4
0
파일: url_vows.py 프로젝트: cezarsa/thumbor
 def topic(self):
     return Url.parse_options("some fake url")
예제 #5
0
 def topic(self):
     return Url.parse_options(
         '/unsafe/meta/10x11:12x13/fit-in/-300x-200/left/top/smart/filters:some_filter()/'
     )
예제 #6
0
 def topic(self):
     return Url.parse_options("some fake url")
예제 #7
0
파일: test_urls.py 프로젝트: torkil/thumbor
def test_parse_urls_without_result():
    options = Url.parse_options("some fake url")

    assert not options
예제 #8
0
def test_parse_urls_without_result():
    options = Url.parse_options("some fake url")

    assert not options
예제 #9
0
 def topic(self):
     return Url.parse_options('unsafe/meta/10x11:12x13/-300x-200/left/top/smart/')