class_docstr: Create a :class:`orion.core.io.database.mongodb.MongoDB`, check connection cases.
class_docstr_tok: ["Create","a",":","class",":","`","orion.core.io.database.mongodb.MongoDB","`",",","check","connection","cases","."]
docstr: Check the case when connecting with partial `uri`.
docstr_tok: ["Check","the","case","when","connecting","with","partial","`","uri","`","."]
code: def test_overwrite_partial_uri(self, monkeypatch):
      """Check the case when connecting with partial `uri`."""
      monkeypatch.setattr(
          MongoDB, "initiate_connection", lambda self: None
      )
  
      orion_db = MongoDB(
          "mongodb://localhost",
          port=1231,
          name="orion",
          username="lala",
          password="none",
      )
      orion_db._sanitize_attrs()
      assert orion_db.host == "localhost"
      assert orion_db.port == 1231
      assert orion_db.username == "lala"
      assert orion_db.password == "none"
      assert orion_db.name == "orion"
  
imports: import functools
  from timeit import timeit
  import pymongo
  import pytest
  from pymongo import MongoClient
  from orion.core.io.database import Database, DatabaseError, DuplicateKeyError
  from orion.core.io.database.mongodb import AUTH_FAILED_MESSAGES, MongoDB
  from .conftest import insert_test_collection
  from .test_database import get_db
label_desc: Use image node_id 5 for calling the TestConnection obj's underlying member method code with example usage: obj.test_overwrite_partial_uri(monkeypatch) without return types