MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / parse_spec_options

Function parse_spec_options

test/utils_shared.py:617–642  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

615
616
617def parse_spec_options(opts):
618 if "readPreference" in opts:
619 opts["read_preference"] = parse_read_preference(opts.pop("readPreference"))
620
621 if "writeConcern" in opts:
622 w_opts = opts.pop("writeConcern")
623 if "journal" in w_opts:
624 w_opts["j"] = w_opts.pop("journal")
625 if "wtimeoutMS" in w_opts:
626 w_opts["wtimeout"] = w_opts.pop("wtimeoutMS")
627 opts["write_concern"] = WriteConcern(**dict(w_opts))
628
629 if "readConcern" in opts:
630 opts["read_concern"] = ReadConcern(**dict(opts.pop("readConcern")))
631
632 if "timeoutMS" in opts:
633 assert isinstance(opts["timeoutMS"], int)
634 opts["timeout"] = int(opts.pop("timeoutMS")) / 1000.0
635
636 if "maxTimeMS" in opts:
637 opts["max_time_ms"] = opts.pop("maxTimeMS")
638
639 if "maxCommitTimeMS" in opts:
640 opts["max_commit_time_ms"] = opts.pop("maxCommitTimeMS")
641
642 return dict(opts)
643
644
645def prepare_spec_arguments(spec, arguments, opname, entity_map, with_txn_callback):

Callers 4

_create_entityMethod · 0.90
run_entity_operationMethod · 0.90
_create_entityMethod · 0.90
run_entity_operationMethod · 0.90

Calls 4

WriteConcernClass · 0.90
ReadConcernClass · 0.90
parse_read_preferenceFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected