Exemple #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
Exemple #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
Exemple #3
0
 def topic(self):
     return Url.parse_options('/unsafe/meta/10x11:12x13/fit-in/-300x-200/left/top/smart/filters:some_filter()/')
Exemple #4
0
 def topic(self):
     return Url.parse_options("some fake url")
Exemple #5
0
 def topic(self):
     return Url.parse_options(
         '/unsafe/meta/10x11:12x13/fit-in/-300x-200/left/top/smart/filters:some_filter()/'
     )
Exemple #6
0
 def topic(self):
     return Url.parse_options("some fake url")
Exemple #7
0
def test_parse_urls_without_result():
    options = Url.parse_options("some fake url")

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

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