docstr: Add a new file to our test manager and return its MediaFile object.
docstr_tok: ["Add","a","new","file","to","our","test","manager","and","return","its","MediaFile","object","."]
code: def _add_file_and_get_object(
      self,
      content: bytes,
      mimetype: str,
      coordinates: str,
      filename: Optional[str] = None,
  ) -> MemoryFile:
      """Add a new file to our test manager and return its MediaFile object."""
      file_id = _calculate_file_id(content, mimetype, filename)
      self.media_file_manager.add(
          content, mimetype, coordinates, filename
      )
      return self.storage.get_file(file_id)
  
imports: import random
  import unittest
  from typing import Optional
  from unittest import TestCase, mock
  from unittest.mock import MagicMock, call, mock_open
  from streamlit.runtime.media_file_manager import MediaFileManager
  from streamlit.runtime.media_file_storage import MediaFileKind
  from streamlit.runtime.memory_media_file_storage import MemoryFile, MemoryMediaFileStorage, _calculate_file_id
  from tests.exception_capturing_thread import call_on_threads
label_desc: Use image node_id 2 for calling the MediaFileManagerTest obj's underlying member method code with example usage: obj._add_file_and_get_object(content, mimetype, coordinates, filename) and returns: self