MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / create_mock_topology

Function create_mock_topology

test/test_topology.py:53–70  ·  view source on GitHub ↗
(
    seeds=None,
    replica_set_name=None,
    monitor_class=DummyMonitor,
    direct_connection=False,
)

Source from the content-addressed store, hash-verified

51
52
53def create_mock_topology(
54 seeds=None,
55 replica_set_name=None,
56 monitor_class=DummyMonitor,
57 direct_connection=False,
58):
59 partitioned_seeds = list(map(common.partition_node, seeds or ["a"]))
60 topology_settings = TopologySettings(
61 partitioned_seeds,
62 replica_set_name=replica_set_name,
63 pool_class=MockPool, # type: ignore[arg-type]
64 monitor_class=monitor_class,
65 direct_connection=direct_connection,
66 )
67
68 t = Topology(topology_settings)
69 t.open()
70 return t
71
72
73def got_hello(topology, server_address, hello_response):

Callers 15

test_reopenMethod · 0.70
test_unavailable_seedMethod · 0.70
test_round_trip_timeMethod · 0.70
test_closeMethod · 0.70
test_handle_errorMethod · 0.70
test_wire_versionMethod · 0.70
test_topology_reprMethod · 0.70

Calls 3

openMethod · 0.95
TopologySettingsClass · 0.90
TopologyClass · 0.90

Tested by

no test coverage detected