Skip to content

Commit

Permalink
Default wire version range is 0-6, not 2-6.
Browse files Browse the repository at this point in the history
Leave the default minWireVersion as 0, not 2. I had been wrong about
MongoDB 3.6's wire version range, I thought it would be 2-6, but it's
0-6. MockupDB now has the same wire version range by default as MongoDB
3.6.
  • Loading branch information
ajdavis committed Dec 6, 2017
1 parent 7bd0cbf commit a402813
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Changelog
=========

Next Release
------------

Set minWireVersion to 0, not to 2. I had been wrong about MongoDB 3.6's wire
version range: it's actually 0 to 6. MockupDB now reports the same wire version
range as MongoDB 3.6 by default.

1.2.0 (2017-09-22)
------------------

Expand Down
4 changes: 2 additions & 2 deletions mockupdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,13 +1099,13 @@ class MockupDB(object):
ismaster requests, or pass a dict or `OpReply`.
- `ssl`: pass ``True`` to require SSL.
- `min_wire_version`: the minWireVersion to include in ismaster responses
if `auto_ismaster` is True, default 2.
if `auto_ismaster` is True, default 0.
- `max_wire_version`: the maxWireVersion to include in ismaster responses
if `auto_ismaster` is True, default 6.
"""
def __init__(self, port=None, verbose=False,
request_timeout=10, auto_ismaster=None,
ssl=False, min_wire_version=2, max_wire_version=6):
ssl=False, min_wire_version=0, max_wire_version=6):
self._address = ('localhost', port)
self._verbose = verbose
self._label = None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mockupdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def test_default_wire_version(self):
server.run()
self.addCleanup(server.stop)
ismaster = MongoClient(server.uri).admin.command('isMaster')
self.assertEqual(ismaster['minWireVersion'], 2)
self.assertEqual(ismaster['minWireVersion'], 0)
self.assertEqual(ismaster['maxWireVersion'], 6)

def test_wire_version(self):
Expand Down

0 comments on commit a402813

Please sign in to comment.