(opts)
| 615 | |
| 616 | |
| 617 | def 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 | |
| 645 | def prepare_spec_arguments(spec, arguments, opname, entity_map, with_txn_callback): |
no test coverage detected