testing default kwargs and obj_kwargs
(self)
| 60 | np.testing.assert_allclose(out, img_save_val) |
| 61 | |
| 62 | def test_write_rgb(self): |
| 63 | """testing default kwargs and obj_kwargs""" |
| 64 | with tempfile.TemporaryDirectory() as out_dir: |
| 65 | image_name = os.path.join(out_dir, "test.png") |
| 66 | img = np.random.rand(2, 3, 3) |
| 67 | img_save_val = (255 * img).astype(np.uint8) |
| 68 | writer_obj = PILWriter(output_dtype=np.uint8) |
| 69 | writer_obj.set_data_array(img, channel_dim=-1) |
| 70 | writer_obj.write(image_name) |
| 71 | out = np.asarray(Image.open(image_name)) |
| 72 | out = np.moveaxis(out, 0, 1) |
| 73 | np.testing.assert_allclose(out, img_save_val) |
| 74 | |
| 75 | def test_write_2channels(self): |
| 76 | with tempfile.TemporaryDirectory() as out_dir: |
nothing calls this directly
no test coverage detected