class_docstr: The ninjo tiff writer tests.
class_docstr_tok: ["The","ninjo","tiff","writer","tests","."]
docstr: Test that a P-mode image is converted to uint8s.
docstr_tok: ["Test","that","a","P-mode","image","is","converted","to","uint8s","."]
code: def test_P_image_is_uint8(self, iwsi, save_dataset):
      """Test that a P-mode image is converted to uint8s."""
      nt = pyninjotiff_mock.ninjotiff
      nt.reset_mock()
      from satpy.writers.ninjotiff import NinjoTIFFWriter
  
      ntw = NinjoTIFFWriter()
      dataset = xr.DataArray([1, 2, 3]).astype(int)
      img = FakeImage(dataset, "P")
      ntw.save_image(img, filename="bla.tif", compute=False)
      assert nt.save.mock_calls[0][1][0].data.dtype == np.uint8
  
file_path: satpy/satpy/tests/writer_tests/test_ninjotiff.py
imports: import sys
  import unittest
  from unittest import mock
  import numpy
  import pytest
  import xarray
label_desc: Use image node_id 8 for calling the TestNinjoTIFFWriter obj's underlying member method code with example usage: obj.test_P_image_is_uint8(iwsi, save_dataset) without return types