code: def test_filesize_max():
      fs = FileStorage(io.BytesIO(b"".ljust(2048)))
      assert validators.FileSize(min="1 KiB", max="2 KiB")(fs) is fs
      assert validators.FileSize(max="2 KiB")(fs) is fs
      assert validators.FileSize()(fs) is fs
      assert (
          validators.FileSize(min_inclusive=False, max_inclusive=False)(
              fs
          )
          is fs
      )
      assert validators.FileSize(min="2 KiB", max="2 KiB")(fs) is fs
  
      with pytest.raises(
          ValidationError, match="less than or equal to 1 KiB"
      ):
          validators.FileSize(min="0 KiB", max="1 KiB")(fs)
      with pytest.raises(
          ValidationError, match="less than or equal to 1 KiB"
      ):
          validators.FileSize(max="1 KiB")(fs)
      with pytest.raises(ValidationError, match="less than 2 KiB"):
          validators.FileSize(
              min="1 KiB",
              max="2 KiB",
              min_inclusive=True,
              max_inclusive=False,
          )(fs)
      with pytest.raises(ValidationError, match="greater than 2 KiB"):
          validators.FileSize(
              min="2 KiB",
              max="2 KiB",
              min_inclusive=False,
              max_inclusive=True,
          )(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 2 for calling a global function with example usage: test_filesize_max() without return types