Esempio n. 1
0
def when_add_inline_picture_to_document(context):
    document = context.document
    context.inline_shape = (document.inline_shapes.add_picture(
        test_file_path('monty-truth.png')))
Esempio n. 2
0
def given_image_filename(context, filename):
    context.image_path = test_file_path(filename)
Esempio n. 3
0
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
Esempio n. 4
0
def when_add_inline_picture_from_file_like_object(context):
    document = context.document
    with open(test_file_path('monty-truth.png'), 'rb') as f:
        context.inline_shape = document.inline_shapes.add_picture(f)
Esempio n. 5
0
def when_add_picture_specifying_width(context):
    document = context.document
    context.picture = document.add_picture(
        test_file_path('monty-truth.png'), width=Inches(1.5)
    )
Esempio n. 6
0
def when_add_inline_picture_to_document(context):
    document = context.document
    context.inline_shape = (document.inline_shapes.add_picture(
        test_file_path('monty-truth.png')
    ))
Esempio n. 7
0
def when_add_inline_picture_from_file_like_object(context):
    document = context.document
    with open(test_file_path('monty-truth.png'), 'rb') as f:
        context.inline_shape = document.inline_shapes.add_picture(f)
Esempio n. 8
0
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
Esempio n. 9
0
def when_add_picture_specifying_width(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'),
                                           width=Inches(1.5))