MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / MockConnection

Class MockConnection

tests/unit/test_control_connection.py:115–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115class MockConnection(object):
116
117 is_defunct = False
118
119 def __init__(self):
120 self.endpoint = DefaultEndPoint("192.168.1.0")
121 self.local_results = [
122 ["schema_version", "cluster_name", "data_center", "rack", "partitioner", "release_version", "tokens"],
123 [["a", "foocluster", "dc1", "rack1", "Murmur3Partitioner", "2.2.0", ["0", "100", "200"]]]
124 ]
125
126 self.peer_results = [
127 ["rpc_address", "peer", "schema_version", "data_center", "rack", "tokens", "host_id"],
128 [["192.168.1.1", "10.0.0.1", "a", "dc1", "rack1", ["1", "101", "201"], "uuid1"],
129 ["192.168.1.2", "10.0.0.2", "a", "dc1", "rack1", ["2", "102", "202"], "uuid2"]]
130 ]
131
132 self.peer_results_v2 = [
133 ["native_address", "native_port", "peer", "peer_port", "schema_version", "data_center", "rack", "tokens", "host_id"],
134 [["192.168.1.1", 9042, "10.0.0.1", 7042, "a", "dc1", "rack1", ["1", "101", "201"], "uuid1"],
135 ["192.168.1.2", 9042, "10.0.0.2", 7040, "a", "dc1", "rack1", ["2", "102", "202"], "uuid2"]]
136 ]
137 self.wait_for_responses = Mock(return_value=_node_meta_results(self.local_results, self.peer_results))
138
139
140class FakeTime(object):

Callers 2

setUpMethod · 0.85
setUpMethod · 0.85

Calls

no outgoing calls

Tested by 2

setUpMethod · 0.68
setUpMethod · 0.68