code: def test_filetype():
      png_fs = FileStorage(io.BytesIO(b"".ljust(1024)), "test.png")
      assert validators.FileType([".png"])(png_fs) is png_fs
      assert validators.FileType([".PNG"])(png_fs) is png_fs
  
      PNG_fs = FileStorage(io.BytesIO(b"".ljust(1024)), "test.PNG")
      assert validators.FileType([".png"])(PNG_fs) is PNG_fs
      assert validators.FileType([".PNG"])(PNG_fs) is PNG_fs
  
      with pytest.raises(
          TypeError, match="A FileStorage object is required, not "
      ):
          validators.FileType([".png"])(1)
  
      with pytest.raises(
          ValidationError,
          match=r"Not an allowed file type. Allowed file types: \[.*?\]",  # noqa: W605
      ):
          jpg_fs = FileStorage(io.BytesIO(b"".ljust(1024)), "test.jpg")
          validators.FileType([".png"])(jpg_fs)
  
      with pytest.raises(
          ValidationError,
          match=r"Not an allowed file type. Allowed file types: \[.*?\]",  # noqa: W605
      ):
          no_ext_fs = FileStorage(io.BytesIO(b"".ljust(1024)), "test")
          validators.FileType([".png"])(no_ext_fs)
  
file_path: apiflask/tests/test_validators.py
imports: import io
  import pytest
  from marshmallow.exceptions import ValidationError
  from werkzeug.datastructures import FileStorage
  from apiflask import validators
label_desc: Use image node_id 5 for calling a global function with example usage: test_filetype() without return types