===============
FakeMongoClient
===============

Test the FakeMongoClient:

  >>> import m01.fake


with default host, port configuration:

  >>> client = m01.fake.FakeMongoClient()
  >>> client
  FakeMongoClient(host=['localhost:45017'])

or with host and port:

  >>> host = '127.0.0.1'
  >>> port = 45017
  >>> client = m01.fake.FakeMongoClient(host, port)
  >>> client
  FakeMongoClient(host=['localhost:45017'])

or with a list of hosts:

  >>> host = ['127.0.0.1:45017', '127.0.0.2:45017']
  >>> client = m01.fake.FakeMongoClient(host)
  >>> type(client)
  <class 'm01.fake.client.MongoClient'>

  >>> client.host
  '127.0.0.2'

  >>> client.port
  45017

  >>> client.event_listeners
  []

  >>> client.address
  '127.0.0.2:45017'

  >>> client.primary
  '127.0.0.2:45017'

  >>> [i for i in client.secondaries]
  []

  >>> [i for i in client.arbiters]
  []

  >>> client.is_primary
  True

  >>> client.is_mongos
  True

  >>> client.max_pool_size
  100

  >>> sorted([i for i in client.nodes])
  [('127.0.0.1', 27017), ('127.0.0.2', 27017)]

  >>> client.max_bson_size
  16777216

  >>> client.max_message_size in [33554432, 48000000]
  True

  >>> client.max_write_batch_size in [1000, 100000]
  True

  >>> client.local_threshold_ms
  15

  >>> client.server_selection_timeout
  30

  >>> client.close()

  >>> client2 = m01.fake.FakeMongoClient(host, port)
  >>> client == client2
  True

  >>> client is client2
  False
