Skip to content

Commit 6923050

Browse files
committed
PYTHON-5059 Fix test
1 parent 41015d1 commit 6923050

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/test_server_description.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from bson.int64 import Int64
2525
from bson.objectid import ObjectId
26+
from pymongo import common
2627
from pymongo.hello import Hello, HelloCompat
2728
from pymongo.server_description import ServerDescription
2829
from pymongo.server_type import SERVER_TYPE
@@ -132,11 +133,13 @@ def test_fields(self):
132133
self.assertEqual(4, s.min_wire_version)
133134
self.assertEqual(25, s.max_wire_version)
134135

135-
def test_default_max_message_size(self):
136-
s = parse_hello_response({"ok": 1, HelloCompat.LEGACY_CMD: True, "maxBsonObjectSize": 2})
137-
138-
# Twice max_bson_size.
139-
self.assertEqual(4, s.max_message_size)
136+
def test_defaults(self):
137+
s = parse_hello_response({"ok": 1, HelloCompat.LEGACY_CMD: True})
138+
self.assertEqual(common.MAX_BSON_SIZE, s.max_bson_size)
139+
self.assertEqual(common.MAX_MESSAGE_SIZE, s.max_message_size)
140+
self.assertEqual(common.MIN_WIRE_VERSION, s.min_wire_version)
141+
self.assertEqual(common.MAX_WIRE_VERSION, s.max_wire_version)
142+
self.assertEqual(common.MAX_WRITE_BATCH_SIZE, s.max_write_batch_size)
140143

141144
def test_standalone(self):
142145
s = parse_hello_response({"ok": 1, HelloCompat.LEGACY_CMD: True})

0 commit comments

Comments
 (0)