File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -626,9 +626,9 @@ def supports_transactions(self):
626626 return "setName" in hello or hello .get ("msg" ) == "isdbgrid"
627627
628628 @cached_property
629- def supports_encryption (self ):
629+ def supports_queryable_encryption (self ):
630630 """
631- Encryption is supported if the server is Atlas or Enterprise
631+ Queryable Encryption is supported if the server is Atlas or Enterprise
632632 and is configured as a replica set or sharded cluster.
633633 """
634634 self .connection .ensure_connection ()
Original file line number Diff line number Diff line change @@ -44,3 +44,17 @@ def mocked_command(command):
4444
4545 with patch ("pymongo.synchronous.database.Database.command" , wraps = mocked_command ):
4646 self .assertIs (connection .features .supports_transactions , False )
47+
48+
49+ class SupportsQueryableEncryptionTests (TestCase ):
50+ # TODO: Add setUp? `del connection.features.supports_queryable_encryption` returns
51+ # `AttributeError: 'DatabasesFeatures' object has no attribute 'supports_queryable_encryption'`
52+ # even though it does have it upon inspection in `pdb`.
53+ def test_supports_queryable_encryption (self ):
54+ def mocked_command (command ):
55+ if command == "buildInfo" :
56+ return {"modules" : ["enterprise" ]}
57+ raise Exception ("Unexpected command" )
58+
59+ with patch ("pymongo.synchronous.database.Database.command" , wraps = mocked_command ):
60+ self .assertIs (connection .features .supports_queryable_encryption , True )
You can’t perform that action at this time.
0 commit comments