def test_process_image_width(): ctx = Context() ctx.image_max_width = 200 ctx.image_extras = '{width="10cm"}' image._process_image_width(ctx) assert ctx.image_extras == '{width="100mm"}'
def test_process_image_width_no_width_given(): ctx = Context() ctx.image_max_width = 100 ctx.image_extras = '' image._process_image_width(ctx) assert ctx.image_extras == '{width="100mm"}'