MCPcopy Index your code
hub / github.com/python-pillow/Pillow / test_encode

Method test_encode

Tests/test_imagefile.py:423–437  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

421 assert MockPyEncoder.last.state.ysize == 200
422
423 def test_encode(self) -> None:
424 encoder = ImageFile.PyEncoder("")
425 with pytest.raises(NotImplementedError):
426 encoder.encode(0)
427
428 bytes_consumed, errcode = encoder.encode_to_pyfd()
429 assert bytes_consumed == 0
430 assert ImageFile.ERRORS[errcode] == "bad configuration"
431
432 encoder._pushes_fd = True
433 with pytest.raises(NotImplementedError):
434 encoder.encode_to_pyfd()
435
436 with pytest.raises(NotImplementedError):
437 encoder.encode_to_file(0, 0)
438
439 def test_zero_height(self) -> None:
440 with pytest.raises(UnidentifiedImageError):

Callers

nothing calls this directly

Calls 3

encodeMethod · 0.95
encode_to_pyfdMethod · 0.95
encode_to_fileMethod · 0.95

Tested by

no test coverage detected