Skip to content

Commit 502effe

Browse files
authored
PYTHON-3167 Fix mockupdb tests for estimated_document_count (#938)
1 parent 9a829ac commit 502effe

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

test/mockupdb/operations.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from collections import namedtuple
1616

17-
from mockupdb import OpMsg, OpMsgReply, OpReply
17+
from mockupdb import OpMsgReply, OpReply
1818

1919
from pymongo import ReadPreference
2020

@@ -61,12 +61,19 @@
6161
not_master=not_master_reply,
6262
),
6363
Operation(
64-
"count",
64+
"count_documents",
6565
lambda client: client.db.collection.count_documents({}),
6666
reply={"n": 1},
6767
op_type="may-use-secondary",
6868
not_master=not_master_reply,
6969
),
70+
Operation(
71+
"estimated_document_count",
72+
lambda client: client.db.collection.estimated_document_count(),
73+
reply={"n": 1},
74+
op_type="may-use-secondary",
75+
not_master=not_master_reply,
76+
),
7077
Operation(
7178
"aggregate",
7279
lambda client: client.db.collection.aggregate([]),
@@ -109,12 +116,4 @@
109116

110117
Upgrade = namedtuple("Upgrade", ["name", "function", "old", "new", "wire_version"])
111118

112-
upgrades = [
113-
Upgrade(
114-
"estimated_document_count",
115-
lambda client: client.db.collection.estimated_document_count(),
116-
old=OpMsg("count", "collection", namespace="db"),
117-
new=OpMsg("aggregate", "collection", namespace="db"),
118-
wire_version=12,
119-
),
120-
]
119+
upgrades = []

0 commit comments

Comments
 (0)