Exemplo n.º 1
0
def test_checker_invalid_order(builder, checker_classes):
    builder.create_used_image("000-001", "0001.jpg")
    builder.create_used_image("000-001", "0000.jpg")
    builder.save_images()
    builder.save_toc([])
    put_transform_contents(builder, "000-001")
    builder.run_program()
    check_all_invalid(builder, checker_classes)
Exemplo n.º 2
0
def test_checker_valid_reference_override(builder, checker_classes):
    builder.create_used_image("000-001", "0000.jpg")
    builder.override_reference_image()
    builder.save_images()
    builder.save_toc([])
    put_transform_contents(builder, "000-001")
    builder.run_program()
    check_all_valid(builder, checker_classes)
Exemplo n.º 3
0
def test_checker_invalid_reference_override(builder, checker_classes):
    (builder.create_used_image("000-001", "0000.jpg")
        .add_border(20, 20, 20, 20, (0, 0, 0)))
    (builder.override_reference_image()
        .add_border(50, 50, 50, 50, (0, 0, 0)))
    builder.save_images()
    builder.save_toc([])
    put_transform_contents(builder, "000-001")
    builder.run_program()
    check_all_invalid(builder, checker_classes)
Exemplo n.º 4
0
def test_toc(builder):
    builder.create_used_image("000-010", "0000.jpg")
    builder.create_used_image("000-010", "0001.jpg")
    builder.create_used_image("000-010", "0002.jpg")
    builder.create_used_image("000-010", "0003.jpg")
    builder.create_used_image("000-010", "0004.jpg")
    builder.save_images()
    builder.save_transform_ini("000-010", "[transform]\njustconvert: yes")
    builder.save_toc([[0, 1, "Page 1"], [1, 2, "Страница 2"],
                      [2, 3, "'Quotes\""], [0, 5, "Page 5"]])
    builder.run_program()
    check_all_valid(builder)
def test_toc(builder):
    builder.create_used_image("000-010", "0000.jpg")
    builder.create_used_image("000-010", "0001.jpg")
    builder.create_used_image("000-010", "0002.jpg")
    builder.create_used_image("000-010", "0003.jpg")
    builder.create_used_image("000-010", "0004.jpg")
    builder.save_images()
    builder.save_transform_ini("000-010", "[transform]\njustconvert: yes")
    builder.save_toc([
        [0, 1, "Page 1"],
        [1, 2, "Страница 2"],
        [2, 3, "'Quotes\""],
        [0, 5, "Page 5"]])
    builder.run_program()
    check_all_valid(builder)
Exemplo n.º 6
0
def postprocess_builder(builder):
    builder.save_images()
    builder.save_toc([])
    builder.save_config("[global]\ntargets: prepare")
Exemplo n.º 7
0
def prepare_three_images(builder):
    for i in range(1, 4):
        builder.create_used_image("001-003", "%04d.jpg" % i)
    builder.save_images()
    put_transform_contents(builder, "001-003")
def postprocess_builder(builder):
    builder.save_images()
    builder.save_toc([])
    builder.save_config("[global]\ntargets: prepare")