MCPcopy Index your code
hub / github.com/python-openxml/python-docx / dimensions_fixture

Method dimensions_fixture

tests/parts/test_image.py:57–71  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

55
56 @pytest.fixture(params=["loaded", "new"])
57 def dimensions_fixture(self, request):
58 image_file_path = test_file("monty-truth.png")
59 image = Image.from_file(image_file_path)
60 expected_cx, expected_cy = 1905000, 2717800
61
62 # case 1: image part is loaded by PartFactory w/no Image inst
63 if request.param == "loaded":
64 partname = PackURI("/word/media/image1.png")
65 content_type = CT.PNG
66 image_part = ImagePart.load(partname, content_type, image.blob, None)
67 # case 2: image part is newly created from image file
68 elif request.param == "new":
69 image_part = ImagePart.from_image(image, None)
70
71 return image_part, expected_cx, expected_cy
72
73 @pytest.fixture(params=["loaded", "new"])
74 def filename_fixture(self, request, image_):

Callers

nothing calls this directly

Calls 5

PackURIClass · 0.90
from_imageMethod · 0.80
test_fileFunction · 0.50
from_fileMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected