Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-401

Add MotorClient.get_default_database

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.1
    • Affects Version/s: None
    • Component/s: None
    • None

      PYTHON-1685 renovated the MongoClient.get_default_database method. We should add this method to Motor. We should add this method and fix the failing synchro tests:

      ======================================================================
      ERROR: test_get_default_database (test.test_client.ClientUnitTest)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/motor/.tox/synchro/tmp/mongo-python-driver/test/test_client.py", line 189, in test_get_default_database
          self.assertEqual(Database(c, 'foo'), c.get_default_database())
      TypeError: 'Database' object is not callable
      
      ======================================================================
      ERROR: test_get_default_database_error (test.test_client.ClientUnitTest)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/motor/.tox/synchro/tmp/mongo-python-driver/test/test_client.py", line 212, in test_get_default_database_error
          self.assertRaises(ConfigurationError, c.get_default_database)
        File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 475, in assertRaises
          callableObj(*args, **kwargs)
      TypeError: 'Database' object is not callable
      
      ======================================================================
      ERROR: test_get_default_database_with_authsource (test.test_client.ClientUnitTest)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/motor/.tox/synchro/tmp/mongo-python-driver/test/test_client.py", line 219, in test_get_default_database_with_authsource
          self.assertEqual(Database(c, 'foo'), c.get_default_database())
      TypeError: 'Database' object is not callable
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: