Skip to content

Commit a83f9a3

Browse files
committed
get spec tests to pass
1 parent 70b4a3a commit a83f9a3

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pymongo/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def get_validated_options(options, warn=True):
717717

718718
def _handle_option_deprecations(options):
719719
"""Issue appropriate warnings when deprecated options are present in the
720-
options dictionary. Also removes deprecated option key, value pairs if the
720+
options dictionary. Removes deprecated option key, value pairs if the
721721
options dictionary is found to also have the renamed option."""
722722
undeprecated_options = {}
723723
for key, value in iteritems(options):

pymongo/uri_parser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
except ImportError:
2424
_HAVE_DNSPYTHON = False
2525

26-
from bson.py3compat import PY3, iteritems, string_type
26+
from bson.py3compat import PY3, string_type
2727

2828
if PY3:
2929
from urllib.parse import unquote_plus
@@ -150,14 +150,17 @@ def parse_host(entity, default_port=DEFAULT_PORT):
150150
def _parse_options(opts, delim):
151151
"""Helper method for split_options which creates the options dict.
152152
Also handles the creation of a list for the URI tag_sets/
153-
readpreferencetags portion."""
153+
readpreferencetags portion and the use of the tlsInsecure option."""
154154
options = {}
155155
for opt in opts.split(delim):
156156
key, value = opt.split("=")
157157
optname = str(key).lower()
158158
if optname == 'readpreferencetags':
159159
options.setdefault(optname, []).append(value)
160160
else:
161+
if optname == 'tlsinsecure':
162+
options['tlsAllowInvalidCertificates'] = value
163+
options['tlsAllowInvalidHostnames'] = value
161164
if key in options:
162165
warnings.warn("Duplicate URI option '%s'." % (str(key),))
163166
options[str(key)] = unquote_plus(value)

test/test_uri_spec.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ def run_scenario(self):
6464
valid = True
6565
warning = False
6666

67-
if test["description"] == "Too low connectTimeoutMS causes a warning":
68-
#import ipdb; ipdb.set_trace()
69-
pass
70-
7167
with warnings.catch_warnings(record=True) as ctx:
7268
warnings.simplefilter('always')
7369
try:

0 commit comments

Comments
 (0)