code: def test_mongo_observer_resource_event(mongo_obs, sample_run):
      mongo_obs.started_event(**sample_run)
  
      filename = "setup.py"
      md5 = get_digest(filename)
  
      mongo_obs.resource_event(filename)
      # Add extra heartbeat to make sure that run is updated.
      info = {"my_info": [1, 2, 3], "nr": 7}
      outp = "some output"
      mongo_obs.heartbeat_event(
          info=info, captured_out=outp, beat_time=T2, result=1337
      )
      mongo_obs.join()
  
      db_run = mongo_obs.runs.find_one()
      assert db_run["resources"][0] == [filename, md5]
  
imports: import datetime
  from sacred.observers.queue import QueueObserver
  import mock
  import pytest
  import sys
  from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics
  import gridfs
  from mongomock.gridfs import enable_gridfs_integration
  import pymongo.errors
  from sacred.dependencies import get_digest
  from sacred.observers.mongo import QueuedMongoObserver, MongoObserver, QueueCompatibleMongoObserver
  from .failing_mongo_mock import ReconnectingMongoClient
label_desc: Use image node_id 11 for calling a global function with example usage: test_mongo_observer_resource_event(mongo_obs, sample_run) without return types