class_docstr: The ninjo tiff writer tests.
class_docstr_tok: ["The","ninjo","tiff","writer","tests","."]
docstr: Test that temperature unit conversions works as expected.
docstr_tok: ["Test","that","temperature","unit","conversions","works","as","expected","."]
code: def test_convert_units_temp(self):
      """Test that temperature unit conversions works as expected."""
      # test converting between °C and K
      from satpy.tests.utils import make_fake_scene
      from satpy.writers.ninjotiff import convert_units
  
      sc = make_fake_scene(
          {"IR108": np.arange(25, dtype="f4").reshape(5, 5)},
          common_attrs={"units": "K"},
      )
      ds_in_k = sc["IR108"]
      for out_unit in ("C", "CELSIUS"):
          ds_out_c = convert_units(ds_in_k, "K", out_unit)
          np.testing.assert_array_almost_equal(
              ds_in_k - 273.15, ds_out_c
          )
          assert ds_in_k.attrs != ds_out_c.attrs
          assert ds_out_c.attrs["units"] == out_unit
      # test that keys aren't lost
      assert ds_out_c.attrs.keys() - ds_in_k.attrs.keys() <= {"units"}
      assert ds_in_k.attrs.keys() <= ds_out_c.attrs.keys()
  
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 6 for calling the TestNinjoTIFFWriter obj's underlying member method code with example usage: obj.test_convert_units_temp() without return types