def filename_fixture(self, request, image_): partname = PackURI('/word/media/image666.png') if request.param == 'loaded': image_part = ImagePart(partname, None, None, None) expected_filename = 'image.png' elif request.param == 'new': image_.filename = 'foobar.PXG' image_part = ImagePart(partname, None, None, image_) expected_filename = image_.filename return image_part, expected_filename
def it_knows_the_sha1_of_its_image(self): blob = b'fO0Bar' image_part = ImagePart(None, None, blob) assert image_part.sha1 == '4921e7002ddfba690a937d54bda226a7b8bdeb68'