Skip to content

Commit 8b9dac0

Browse files
committed
add tests for dns resolution behavior
1 parent 2afa635 commit 8b9dac0

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/integration/simulacron/test_cluster.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import unittest # noqa
1818

1919
from tests.integration.simulacron import SimulacronCluster
20-
from tests.integration import requiressimulacron
20+
from tests.integration import (requiressimulacron, PROTOCOL_VERSION)
2121
from tests.integration.simulacron.utils import prime_query
2222

2323
from cassandra import WriteTimeout, WriteType, ConsistencyLevel
@@ -55,3 +55,19 @@ def test_writetimeout(self):
5555
self.assertIn(consistency, str(wt))
5656
self.assertIn(str(received_responses), str(wt))
5757
self.assertIn(str(required_responses), str(wt))
58+
59+
def test_connection_with_one_unresolvable_contact_point(self):
60+
self.cluster.shutdown()
61+
62+
# shouldn't raise anything due to name resolution failures
63+
Cluster(['127.0.0.1', 'doesntresolve.becauseitcant'],
64+
protocol_version=PROTOCOL_VERSION,
65+
compression=False)
66+
67+
def test_connection_with_only_unresolvable_contact_points(self):
68+
self.cluster.shutdown()
69+
70+
# shouldn't raise anything due to name resolution failures
71+
Cluster(['doesntresolve.becauseitcant'],
72+
protocol_version=PROTOCOL_VERSION,
73+
compression=False)

0 commit comments

Comments
 (0)