Exemplo n.º 1
0
def test_get_image_info():
    # some random jpg/gif/png images from my imgur account
    jpg = "http://i.imgur.com/NgVIeRG.jpg"
    gif = "http://i.imgur.com/l3Vmp4m.gif"
    png = "http://i.imgur.com/JXzKxNs.png"

    # Issue #207 Image - This works now
    #issue_img = "http://b.reich.io/gtlbjc.jpg"
    #issue_img = get_image_info(issue_img)
    #assert issue_img["content_type"] == "JPEG"

    jpg_img = get_image_info(jpg)
    assert jpg_img["content_type"] == "JPEG"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06

    gif_img = get_image_info(gif)
    assert gif_img["content_type"] == "GIF"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138

    png_img = get_image_info(png)
    assert png_img["content_type"] == "PNG"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409
Exemplo n.º 2
0
def test_get_image_info():
    # some random jpg/gif/png images from my imgur account
    jpg = "http://i.imgur.com/NgVIeRG.jpg"
    gif = "http://i.imgur.com/l3Vmp4m.gif"
    png = "http://i.imgur.com/JXzKxNs.png"

    # Issue #207 Image - This works now
    # issue_img = "http://b.reich.io/gtlbjc.jpg"
    # issue_img = get_image_info(issue_img)
    # assert issue_img["content_type"] == "JPEG"

    jpg_img = get_image_info(jpg)
    assert jpg_img["content_type"] == "JPEG"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06

    gif_img = get_image_info(gif)
    assert gif_img["content_type"] == "GIF"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138

    png_img = get_image_info(png)
    assert png_img["content_type"] == "PNG"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409
Exemplo n.º 3
0
def test_get_image_info_png(responses, image_png):
    responses.add(image_png)
    png_img = get_image_info(image_png.url)
    assert png_img["content_type"] == "PNG"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409
Exemplo n.º 4
0
def test_get_image_info_gif(responses, image_gif):
    responses.add(image_gif)
    gif_img = get_image_info(image_gif.url)
    assert gif_img["content_type"] == "GIF"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138
Exemplo n.º 5
0
def test_get_image_info_jpg(responses, image_jpg):
    responses.add(image_jpg)
    jpg_img = get_image_info(image_jpg.url)
    assert jpg_img["content_type"] == "JPEG"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06
Exemplo n.º 6
0
def test_get_image_info_png(responses, image_png):
    responses.add(image_png)
    png_img = get_image_info(image_png.url)
    assert png_img["content_type"] == "PNG"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409
Exemplo n.º 7
0
def test_get_image_info_gif(responses, image_gif):
    responses.add(image_gif)
    gif_img = get_image_info(image_gif.url)
    assert gif_img["content_type"] == "GIF"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138
Exemplo n.º 8
0
def test_get_image_info_jpg(responses, image_jpg):
    responses.add(image_jpg)
    jpg_img = get_image_info(image_jpg.url)
    assert jpg_img["content_type"] == "JPEG"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06
Exemplo n.º 9
0
def test_get_image_info():
    # some random jpg/gif/png images from my imgur account
    jpg = "http://i.imgur.com/NgVIeRG.jpg"
    gif = "http://i.imgur.com/l3Vmp4m.gif"
    png = "http://i.imgur.com/JXzKxNs.png"

    jpg_img = get_image_info(jpg)
    assert jpg_img["content-type"] == "image/jpeg"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06

    gif_img = get_image_info(gif)
    assert gif_img["content-type"] == "image/gif"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138

    png_img = get_image_info(png)
    assert png_img["content-type"] == "image/png"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409
Exemplo n.º 10
0
def test_get_image_info():
    # some random jpg/gif/png images from my imgur account
    jpg = "http://i.imgur.com/NgVIeRG.jpg"
    gif = "http://i.imgur.com/l3Vmp4m.gif"
    png = "http://i.imgur.com/JXzKxNs.png"

    jpg_img = get_image_info(jpg)
    assert jpg_img["content-type"] == "image/jpeg"
    assert jpg_img["height"] == 1024
    assert jpg_img["width"] == 1280
    assert jpg_img["size"] == 209.06

    gif_img = get_image_info(gif)
    assert gif_img["content-type"] == "image/gif"
    assert gif_img["height"] == 168
    assert gif_img["width"] == 400
    assert gif_img["size"] == 576.138

    png_img = get_image_info(png)
    assert png_img["content-type"] == "image/png"
    assert png_img["height"] == 1080
    assert png_img["width"] == 1920
    assert png_img["size"] == 269.409