コード例 #1
0
    def it_can_load_a_blob_from_a_file_path_to_help(self):
        path = absjoin(test_file_dir, "minimal.pptx")
        with open(path, "rb") as f:
            file_bytes = f.read()
        part = Part(None, None, None, None)

        assert part._blob_from_file(path) == file_bytes
コード例 #2
0
 def it_can_load_a_blob_from_a_file_like_object_to_help(self):
     part = Part(None, None, None, None)
     assert part._blob_from_file(io.BytesIO(b"012345")) == b"012345"