Skip to content

Commit

Permalink
PYTHON-4806 Fix expected metadata in mockupdb tests (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 1, 2024
1 parent 7fbeca9 commit 0279407
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ features = ["test"]
test = "pytest -v --durations=5 --maxfail=10 {args}"
test-eg = "bash ./.evergreen/run-tests.sh {args}"
test-async = "pytest -v --durations=5 --maxfail=10 -m default_async {args}"
test-mockupdb = ["pip install -U git+https://github.com/ajdavis/mongo-mockup-db@master", "test -m mockupdb"]
test-mockupdb = ["pip install -U git+https://github.com/mongodb-labs/mongo-mockup-db@master", "test -m mockupdb"]

[envs.encryption]
skip-install = true
Expand Down
8 changes: 6 additions & 2 deletions test/mockupdb/test_handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


from bson.objectid import ObjectId
from pymongo import MongoClient
from pymongo import MongoClient, has_c
from pymongo import version as pymongo_version
from pymongo.errors import OperationFailure
from pymongo.server_api import ServerApi, ServerApiVersion
Expand All @@ -39,7 +39,11 @@ def _check_handshake_data(request):
data = request["client"]

assert data["application"] == {"name": "my app"}
assert data["driver"] == {"name": "PyMongo", "version": pymongo_version}
if has_c():
name = "PyMongo|c"
else:
name = "PyMongo"
assert data["driver"] == {"name": name, "version": pymongo_version}

# Keep it simple, just check these fields exist.
assert "os" in data
Expand Down

0 comments on commit 0279407

Please sign in to comment.