Skip to content

Commit 8974779

Browse files
committed
fix(tests/integration/__init__.py): Rename "TestCluster" to "IntegrationTestCluster"
1 parent 5762a3d commit 8974779

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+287
-287
lines changed

tests/integration/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_server_versions():
7575
if cass_version is not None:
7676
return (cass_version, cql_version)
7777

78-
c = TestCluster()
78+
c = IntegrationTestCluster()
7979
s = c.connect()
8080
row = s.execute('SELECT cql_version, release_version FROM system.local')[0]
8181

@@ -706,9 +706,9 @@ def setup_keyspace(ipformat=None, wait=True, protocol_version=None):
706706
_protocol_version = PROTOCOL_VERSION
707707

708708
if not ipformat:
709-
cluster = TestCluster(protocol_version=_protocol_version)
709+
cluster = IntegrationTestCluster(protocol_version=_protocol_version)
710710
else:
711-
cluster = TestCluster(contact_points=["::1"], protocol_version=_protocol_version)
711+
cluster = IntegrationTestCluster(contact_points=["::1"], protocol_version=_protocol_version)
712712
session = cluster.connect()
713713

714714
try:
@@ -802,7 +802,7 @@ def create_keyspace(cls, rf):
802802

803803
@classmethod
804804
def common_setup(cls, rf, keyspace_creation=True, create_class_table=False, **cluster_kwargs):
805-
cls.cluster = TestCluster(**cluster_kwargs)
805+
cls.cluster = IntegrationTestCluster(**cluster_kwargs)
806806
cls.session = cls.cluster.connect(wait_for_all_pools=True)
807807
cls.ks_name = cls.__name__.lower()
808808
if keyspace_creation:
@@ -990,7 +990,7 @@ def assert_startswith(s, prefix):
990990
)
991991

992992

993-
class TestCluster(object):
993+
class IntegrationTestCluster(object):
994994
DEFAULT_PROTOCOL_VERSION = default_protocol_version
995995
DEFAULT_CASSANDRA_IP = CASSANDRA_IP
996996
DEFAULT_ALLOW_BETA = ALLOW_BETA_PROTOCOL

tests/integration/advanced/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from ccmlib import common
2727

2828
from tests.integration import get_server_versions, BasicKeyspaceUnitTestCase, \
29-
drop_keyspace_shutdown_cluster, get_node, USE_CASS_EXTERNAL, TestCluster
29+
drop_keyspace_shutdown_cluster, get_node, USE_CASS_EXTERNAL, IntegrationTestCluster
3030
from tests.integration import use_singledc, use_single_node, wait_for_node_socket, CASSANDRA_IP
3131

3232
home = expanduser('~')
@@ -106,7 +106,7 @@ def use_cluster_with_graph(num_nodes):
106106
# Wait for spark master to start up
107107
spark_master_http = ("localhost", 7080)
108108
common.check_socket_listening(spark_master_http, timeout=60)
109-
tmp_cluster = TestCluster()
109+
tmp_cluster = IntegrationTestCluster()
110110

111111
# Start up remaining nodes.
112112
try:
@@ -134,7 +134,7 @@ class BasicGeometricUnitTestCase(BasicKeyspaceUnitTestCase):
134134

135135
@classmethod
136136
def common_dse_setup(cls, rf, keyspace_creation=True):
137-
cls.cluster = TestCluster()
137+
cls.cluster = IntegrationTestCluster()
138138
cls.session = cls.cluster.connect()
139139
cls.ks_name = cls.__name__.lower()
140140
if keyspace_creation:

tests/integration/advanced/graph/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def session_setup(self):
160160
)
161161
)
162162

163-
self.cluster = TestCluster(execution_profiles={
163+
self.cluster = IntegrationTestCluster(execution_profiles={
164164
EXEC_PROFILE_GRAPH_DEFAULT: ep_graphson1,
165165
EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT: ep_analytics,
166166
"graphson1": ep_graphson1,
@@ -275,7 +275,7 @@ def session_setup(self):
275275
)
276276
)
277277

278-
self.cluster = TestCluster(execution_profiles={
278+
self.cluster = IntegrationTestCluster(execution_profiles={
279279
EXEC_PROFILE_GRAPH_DEFAULT: ep_graphson1,
280280
EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT: ep_analytics,
281281
"graphson1": ep_graphson1,
@@ -360,7 +360,7 @@ class BasicSharedGraphUnitTestCase(BasicKeyspaceUnitTestCase):
360360

361361
@classmethod
362362
def session_setup(cls):
363-
cls.cluster = TestCluster()
363+
cls.cluster = IntegrationTestCluster()
364364
cls.session = cls.cluster.connect()
365365
cls.ks_name = cls.__name__.lower()
366366
cls.cass_version, cls.cql_version = get_server_versions()

tests/integration/advanced/graph/test_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from cassandra.util import SortedSet
2626

2727
from tests.integration import DSE_VERSION, greaterthanorequaldse51, greaterthanorequaldse68, \
28-
requiredse, TestCluster
28+
requiredse, IntegrationTestCluster
2929
from tests.integration.advanced.graph import BasicGraphUnitTestCase, GraphUnitTestCase, \
3030
GraphProtocol, ClassicGraphSchema, CoreGraphSchema, use_single_node_with_graph
3131

@@ -150,7 +150,7 @@ def test_graph_profile(self):
150150
exec_short_timeout.graph_options.graph_name = self.graph_name
151151

152152
# Add a single execution policy on cluster creation
153-
local_cluster = TestCluster(execution_profiles={"exec_dif_factory": exec_dif_factory})
153+
local_cluster = IntegrationTestCluster(execution_profiles={"exec_dif_factory": exec_dif_factory})
154154
local_session = local_cluster.connect()
155155
self.addCleanup(local_cluster.shutdown)
156156

tests/integration/advanced/test_adv_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
BasicSharedKeyspaceUnitTestCaseRF1,
1919
greaterthanorequaldse51, greaterthanorequaldse60,
2020
greaterthanorequaldse68, use_single_node,
21-
DSE_VERSION, requiredse, TestCluster)
21+
DSE_VERSION, requiredse, IntegrationTestCluster)
2222

2323
try:
2424
import unittest2 as unittest
@@ -392,4 +392,4 @@ def test_connection_on_graph_schema_error(self):
392392
""" % (self.ks_name,))
393393

394394
self.session.execute('TRUNCATE system_schema.vertices')
395-
TestCluster().connect().shutdown()
395+
IntegrationTestCluster().connect().shutdown()

tests/integration/advanced/test_auth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from cassandra.protocol import Unauthorized
3131
from cassandra.query import SimpleStatement
3232
from tests.integration import (get_cluster, greaterthanorequaldse51,
33-
remove_cluster, requiredse, DSE_VERSION, TestCluster)
33+
remove_cluster, requiredse, DSE_VERSION, IntegrationTestCluster)
3434
from tests.integration.advanced import ADS_HOME, use_single_node_with_graph
3535
from tests.integration.advanced.graph import reset_graph, ClassicGraphFixtures
3636

@@ -158,7 +158,7 @@ def connect_and_query(self, auth_provider, query=None):
158158
Runs a simple system query with the auth_provided specified.
159159
"""
160160
os.environ['KRB5_CONFIG'] = self.krb_conf
161-
self.cluster = TestCluster(auth_provider=auth_provider)
161+
self.cluster = IntegrationTestCluster(auth_provider=auth_provider)
162162
self.session = self.cluster.connect()
163163
query = query if query else "SELECT * FROM system.local"
164164
statement = SimpleStatement(query)
@@ -321,7 +321,7 @@ def _remove_proxy_setup(self):
321321
os.environ['KRB5_CONFIG'] = self.krb_conf
322322
self.refresh_kerberos_tickets(self.cassandra_keytab, "[email protected]", self.krb_conf)
323323
auth_provider = DSEGSSAPIAuthProvider(service='dse', qops=["auth"], principal='[email protected]')
324-
cluster = TestCluster(auth_provider=auth_provider)
324+
cluster = IntegrationTestCluster(auth_provider=auth_provider)
325325
session = cluster.connect()
326326

327327
session.execute("REVOKE PROXY.LOGIN ON ROLE '{0}' FROM '{1}'".format('[email protected]', '[email protected]'))
@@ -339,7 +339,7 @@ def _setup_for_proxy(self, grant=True):
339339
os.environ['KRB5_CONFIG'] = self.krb_conf
340340
self.refresh_kerberos_tickets(self.cassandra_keytab, "[email protected]", self.krb_conf)
341341
auth_provider = DSEGSSAPIAuthProvider(service='dse', qops=["auth"], principal='[email protected]')
342-
cluster = TestCluster(auth_provider=auth_provider)
342+
cluster = IntegrationTestCluster(auth_provider=auth_provider)
343343
session = cluster.connect()
344344

345345
stmts = [
@@ -404,7 +404,7 @@ def setUpClass(self):
404404
# Create users and test keyspace
405405
self.user_role = 'user1'
406406
self.server_role = 'server'
407-
self.root_cluster = TestCluster(auth_provider=DSEPlainTextAuthProvider('cassandra', 'cassandra'))
407+
self.root_cluster = IntegrationTestCluster(auth_provider=DSEPlainTextAuthProvider('cassandra', 'cassandra'))
408408
self.root_session = self.root_cluster.connect()
409409

410410
stmts = [
@@ -470,7 +470,7 @@ def get_sasl_options(self, mechanism='PLAIN'):
470470
return sasl_options
471471

472472
def connect_and_query(self, auth_provider, execute_as=None, query="SELECT * FROM testproxy.testproxy"):
473-
self.cluster = TestCluster(auth_provider=auth_provider)
473+
self.cluster = IntegrationTestCluster(auth_provider=auth_provider)
474474
self.session = self.cluster.connect()
475475
rs = self.session.execute(query, execute_as=execute_as)
476476
return rs

tests/integration/advanced/test_cont_paging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from tests.integration import use_singledc, greaterthanorequaldse51, BasicSharedKeyspaceUnitTestCaseRF3WM, \
16-
DSE_VERSION, ProtocolVersion, greaterthanorequaldse60, requiredse, TestCluster
16+
DSE_VERSION, ProtocolVersion, greaterthanorequaldse60, requiredse, IntegrationTestCluster
1717

1818
import logging
1919
log = logging.getLogger(__name__)
@@ -64,7 +64,7 @@ def tearDownClass(cls):
6464
@classmethod
6565
def create_cluster(cls):
6666

67-
cls.cluster_with_profiles = TestCluster(protocol_version=cls.protocol_version, execution_profiles=cls.execution_profiles)
67+
cls.cluster_with_profiles = IntegrationTestCluster(protocol_version=cls.protocol_version, execution_profiles=cls.execution_profiles)
6868

6969
cls.session_with_profiles = cls.cluster_with_profiles.connect(wait_for_all_pools=True)
7070
statements_and_params = zip(

tests/integration/advanced/test_cqlengine_where_operators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
create_keyspace_simple, drop_table,
2626
sync_table)
2727
from cassandra.cqlengine.statements import IsNotNull
28-
from tests.integration import DSE_VERSION, requiredse, CASSANDRA_IP, greaterthanorequaldse60, TestCluster
28+
from tests.integration import DSE_VERSION, requiredse, CASSANDRA_IP, greaterthanorequaldse60, IntegrationTestCluster
2929
from tests.integration.advanced import use_single_node_with_graph_and_solr
3030
from tests.integration.cqlengine import DEFAULT_KEYSPACE
3131

@@ -64,7 +64,7 @@ class IsNotNullTests(unittest.TestCase):
6464
@classmethod
6565
def setUpClass(cls):
6666
if DSE_VERSION:
67-
cls.cluster = TestCluster()
67+
cls.cluster = IntegrationTestCluster()
6868

6969
@greaterthanorequaldse60
7070
def test_is_not_null_execution(self):
@@ -80,7 +80,7 @@ def test_is_not_null_execution(self):
8080
8181
@test_category cqlengine
8282
"""
83-
cluster = TestCluster()
83+
cluster = IntegrationTestCluster()
8484
self.addCleanup(cluster.shutdown)
8585
session = cluster.connect()
8686

tests/integration/advanced/test_unixsocketendpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from cassandra.policies import WhiteListRoundRobinPolicy, RoundRobinPolicy
2626

2727
from tests import notwindows
28-
from tests.integration import use_single_node, TestCluster
28+
from tests.integration import use_single_node, IntegrationTestCluster
2929

3030
log = logging.getLogger()
3131
log.setLevel('DEBUG')
@@ -65,7 +65,7 @@ def setUpClass(cls):
6565
lbp = UnixSocketWhiteListRoundRobinPolicy([UNIX_SOCKET_PATH])
6666
ep = ExecutionProfile(load_balancing_policy=lbp)
6767
endpoint = UnixSocketEndPoint(UNIX_SOCKET_PATH)
68-
cls.cluster = TestCluster(contact_points=[endpoint], execution_profiles={EXEC_PROFILE_DEFAULT: ep})
68+
cls.cluster = IntegrationTestCluster(contact_points=[endpoint], execution_profiles={EXEC_PROFILE_DEFAULT: ep})
6969

7070
@classmethod
7171
def tearDownClass(cls):

tests/integration/cqlengine/advanced/test_cont_paging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from cassandra.cqlengine import columns, connection, models
2828
from cassandra.cqlengine.management import drop_table, sync_table
2929
from tests.integration import (DSE_VERSION, greaterthanorequaldse51,
30-
greaterthanorequaldse60, requiredse, TestCluster)
30+
greaterthanorequaldse60, requiredse, IntegrationTestCluster)
3131

3232

3333
class TestMultiKeyModel(models.Model):
@@ -76,8 +76,8 @@ def tearDownClass(cls):
7676
def _create_cluster_with_cp_options(cls, name, cp_options):
7777
execution_profiles = {EXEC_PROFILE_DEFAULT:
7878
ExecutionProfile(continuous_paging_options=cp_options)}
79-
cls.cluster_default = TestCluster(protocol_version=cls.protocol_version,
80-
execution_profiles=execution_profiles)
79+
cls.cluster_default = IntegrationTestCluster(protocol_version=cls.protocol_version,
80+
execution_profiles=execution_profiles)
8181
cls.session_default = cls.cluster_default.connect(wait_for_all_pools=True)
8282
connection.register_connection(name, default=True, session=cls.session_default)
8383
cls.connections.add(name)

0 commit comments

Comments
 (0)