======
README
======

This is a second test which makes sure we can tear down the previous server and
start a new one:

  >>> from pprint import pprint
  >>> import pymongo
  >>> from pymongo.periodic_executor import _shutdown_executors
  >>> conn = pymongo.MongoClient('localhost', 45017)

Let's test our mongodb stub setup:

  >>> pprint(conn.server_info())
  {...,
   u'ok': 1.0,
   ...}

  >>> conn.database_names()
  [u'admin', u'local']

setup an index:

  >>> conn.m01_stub_testing.test.collection.ensure_index('dummy')
  u'dummy_1'

add an object:

  >>> _id = conn.m01_stub_testing.test.save({'__name__': u'foo', 'dummy': u'object'})
  >>> _id
  ObjectId('...')

remove them:

  >>> conn.m01_stub_testing.test.remove({'_id': _id})
  {...}

and check the databsae names again:

  >>> conn.database_names()
  [u'admin', u'local', u'm01_stub_testing']

Let's drop the database:

  >>> conn.drop_database("m01_stub_testing")
  >>> conn.database_names()
  [u'admin', u'local']


Close client:

  >>> conn.close()
  >>> _shutdown_executors()
