code: def test_xyres_fallback_tiff(self):
      filename = "Tests/images/compression.tif"
      with Image.open(filename) as im:
          # v2 api
          assert isinstance(
              im.tag_v2[X_RESOLUTION], TiffImagePlugin.IFDRational
          )
          assert isinstance(
              im.tag_v2[Y_RESOLUTION], TiffImagePlugin.IFDRational
          )
          with pytest.raises(KeyError):
              im.tag_v2[RESOLUTION_UNIT]
  
          # Legacy.
          assert im.info["resolution"] == (100.0, 100.0)
          # Fallback "inch".
          assert im.info["dpi"] == (100.0, 100.0)
  
imports: import os
  from io import BytesIO
  import pytest
  from PIL import Image, ImageFile, TiffImagePlugin
  from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar, assert_image_similar_tofile, hopper, is_pypy, is_win32
label_desc: Use image node_id 9 for calling the TestFileTiff obj's underlying member method code with example usage: obj.test_xyres_fallback_tiff() without return types