MCPcopy Create free account
hub / github.com/scanny/python-pptx / it_can_construct_from_a_path

Method it_can_construct_from_a_path

tests/parts/test_image.py:94–102  ·  view source on GitHub ↗
(self, from_blob_, image_)

Source from the content-addressed store, hash-verified

92 """Unit-test suite for `pptx.parts.image.Image` objects."""
93
94 def it_can_construct_from_a_path(self, from_blob_, image_):
95 with open(test_image_path, "rb") as f:
96 blob = f.read()
97 from_blob_.return_value = image_
98
99 image = Image.from_file(test_image_path)
100
101 Image.from_blob.assert_called_once_with(blob, "python-icon.jpeg")
102 assert image is image_
103
104 def it_can_construct_from_a_stream(self, from_stream_fixture):
105 image_file, blob, image_ = from_stream_fixture

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
from_fileMethod · 0.80

Tested by

no test coverage detected