code: def test_database_resource(queue_mongo_host: str) -> None:
      database_1 = "datasets_server_1"
      database_2 = "datasets_server_2"
      host = queue_mongo_host
      mongoengine_alias = "datasets_server_mongo_alias"
      server_selection_timeout_ms = 5_000
      resource_1 = MongoResource(
          database=database_1,
          host=host,
          mongoengine_alias=mongoengine_alias,
          server_selection_timeout_ms=server_selection_timeout_ms,
      )
      assert resource_1.is_available()
      with pytest.raises(MongoConnectionFailure):
          MongoResource(
              database=database_2,
              host=host,
              mongoengine_alias=mongoengine_alias,
              server_selection_timeout_ms=server_selection_timeout_ms,
          )
      resource_1.release()
      resource_2 = MongoResource(
          database=database_2,
          host=host,
          mongoengine_alias=mongoengine_alias,
          server_selection_timeout_ms=server_selection_timeout_ms,
      )
      assert resource_2.is_available()
      resource_2.release()
  
file_path: datasets-server/libs/libcommon/tests/test_resources.py
imports: from typing import Optional
  import pytest
  from mongoengine import Document
  from mongoengine.fields import StringField
  from pymongo.errors import ServerSelectionTimeoutError
  from libcommon.resources import CacheMongoResource, MetricsMongoResource, MongoConnectionFailure, MongoResource, QueueMongoResource
label_desc: Use image node_id 1 for calling a global function with example usage: test_database_resource(queue_mongo_host) without return types