コード例 #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
ファイル: test_urls.py プロジェクト: rootart/thumbor
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
ファイル: url_vows.py プロジェクト: rahbirul/thumbor
 def topic(self):
     return Url.parse_options(
         '/unsafe/meta/10x11:12x13/fit-in/-300x-200/left/top/smart/filters:some_filter()/'
     )
コード例 #6
0
ファイル: url_vows.py プロジェクト: rahbirul/thumbor
 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
ファイル: url_vows.py プロジェクト: cicerocomp/thumbor
 def topic(self):
     return Url.parse_options('unsafe/meta/10x11:12x13/-300x-200/left/top/smart/')