38
38
"ATLAS_FREE" : os .environ .get ("ATLAS_FREE" ),
39
39
"ATLAS_TLS11" : os .environ .get ("ATLAS_TLS11" ),
40
40
"ATLAS_TLS12" : os .environ .get ("ATLAS_TLS12" ),
41
+ "ATLAS_SERVERLESS" : os .environ .get ("ATLAS_SERVERLESS" ),
41
42
"ATLAS_SRV_REPL" : os .environ .get ("ATLAS_SRV_REPL" ),
42
43
"ATLAS_SRV_SHRD" : os .environ .get ("ATLAS_SRV_SHRD" ),
43
44
"ATLAS_SRV_FREE" : os .environ .get ("ATLAS_SRV_FREE" ),
44
45
"ATLAS_SRV_TLS11" : os .environ .get ("ATLAS_SRV_TLS11" ),
45
46
"ATLAS_SRV_TLS12" : os .environ .get ("ATLAS_SRV_TLS12" ),
47
+ "ATLAS_SRV_SERVERLESS" : os .environ .get ("ATLAS_SRV_SERVERLESS" ),
46
48
}
47
49
48
50
# Set this variable to true to run the SRV tests even when dnspython is not
@@ -77,6 +79,9 @@ def test_tls_11(self):
77
79
def test_tls_12 (self ):
78
80
connect (URIS ['ATLAS_TLS12' ])
79
81
82
+ def test_serverless (self ):
83
+ connect (URIS ['ATLAS_SERVERLESS' ])
84
+
80
85
def connect_srv (self , uri ):
81
86
connect (uri )
82
87
self .assertIn ('mongodb+srv://' , uri )
@@ -102,6 +107,10 @@ def test_srv_tls_11(self):
102
107
def test_srv_tls_12 (self ):
103
108
self .connect_srv (URIS ['ATLAS_SRV_TLS12' ])
104
109
110
+ @unittest .skipUnless (HAS_DNS or MUST_TEST_SRV , 'SRV requires dnspython' )
111
+ def test_srv_serverless (self ):
112
+ self .connect_srv (URIS ['ATLAS_SRV_SERVERLESS' ])
113
+
105
114
def test_uniqueness (self ):
106
115
"""Ensure that we don't accidentally duplicate the test URIs."""
107
116
uri_to_names = defaultdict (list )
@@ -114,6 +123,5 @@ def test_uniqueness(self):
114
123
'duplicate values: %s' % (duplicates ,))
115
124
116
125
117
-
118
126
if __name__ == '__main__' :
119
127
unittest .main ()
0 commit comments