예제 #1
0
def test_bin_clear_images(env, resizetarget_opts, image1_name, image1_data):
    resize_target = flask_resize.ResizeTarget(**resizetarget_opts)

    resize_target.image_store.save(image1_name, image1_data)
    resize_target.generate()
    run(env, "flask-resize", "clear", "images")
    assert run(env, "flask-resize", "list", "images") == []
예제 #2
0
def test_bin_clear_images(env, resizetarget_opts, image1_name, image1_data):
    resize_target = flask_resize.ResizeTarget(**resizetarget_opts)

    resize_target.image_store.save(image1_name, image1_data)
    resize_target.generate()
    run(env, 'flask-resize', 'clear', 'images')
    assert run(env, 'flask-resize', 'list', 'images') == []
예제 #3
0
def test_bin_sync_cache(env, resizetarget_opts, image1_name, image1_data,
                        image1_key, redis_cache):
    resize_target = flask_resize.ResizeTarget(**resizetarget_opts)

    resize_target.image_store.save(image1_name, image1_data)
    resize_target.generate()

    redis_cache.clear()

    assert run(env, 'flask-resize', 'list', 'cache') == []

    run(env, 'flask-resize', 'sync', 'cache')

    assert run(env, 'flask-resize', 'list', 'images') == [image1_key]
예제 #4
0
def test_bin_sync_cache(
    env, resizetarget_opts, image1_name, image1_data, image1_key, redis_cache
):
    resize_target = flask_resize.ResizeTarget(**resizetarget_opts)

    resize_target.image_store.save(image1_name, image1_data)
    resize_target.generate()

    redis_cache.clear()

    assert run(env, "flask-resize", "list", "cache") == []

    run(env, "flask-resize", "sync", "cache")

    assert run(env, "flask-resize", "list", "images") == [image1_key]