Skip to content

Commit 4199716

Browse files
committed
add PYTHON-1018 tests
1 parent 682be3c commit 4199716

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

tests/integration/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,14 @@ def is_current_cluster(cluster_name, node_counts):
351351

352352

353353
def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=[], set_keyspace=True, ccm_options=None,
354-
configuration_options={}, dse_cluster=False, dse_options={}):
354+
configuration_options={}, dse_cluster=False, dse_options={},
355+
dse_version=None):
356+
if (dse_version and not dse_cluster):
357+
raise ValueError('specified dse_version {} but not dse_cluster'.format(dse_version))
355358
set_default_cass_ip()
356359

357360
if ccm_options is None and dse_cluster:
358-
ccm_options = {"version": DSE_VERSION}
361+
ccm_options = {"version": dse_version or DSE_VERSION}
359362
elif ccm_options is None:
360363
ccm_options = CCM_KWARGS.copy()
361364

tests/integration/standard/test_dse.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,22 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
try:
16-
import unittest2 as unittest
17-
except ImportError:
18-
import unittest # noqa
15+
import os
1916

17+
from packaging.version import Version
2018

2119
from cassandra.cluster import Cluster
22-
from tests import is_windows, notwindows
23-
from tests.integration import (CLUSTER_NAME, PROTOCOL_VERSION,
24-
execute_until_pass,
20+
from tests import notwindows
21+
from tests.integration import (execute_until_pass,
2522
execute_with_long_wait_retry, use_cluster)
2623

27-
28-
def setup_module():
29-
if is_windows():
30-
return
31-
use_cluster(CLUSTER_NAME, [3], dse_cluster=True, dse_options={})
24+
try:
25+
import unittest2 as unittest
26+
except ImportError:
27+
import unittest # noqa
3228

3329

30+
@unittest.skipIf(os.environ.get('CCM_ARGS', None), 'environment has custom CCM_ARGS; skipping')
3431
@notwindows
3532
class DseCCMClusterTest(unittest.TestCase):
3633
"""
@@ -39,12 +36,23 @@ class DseCCMClusterTest(unittest.TestCase):
3936
If CASSANDRA_VERSION is set instead, it will be converted to the corresponding DSE_VERSION
4037
"""
4138

42-
def test_basic(self):
39+
def test_dse_5x(self):
40+
self._test_basic(Version('5.1.10'))
41+
42+
def test_dse_60(self):
43+
self._test_basic(Version('6.0.2'))
44+
45+
def _test_basic(self, dse_version):
4346
"""
4447
Test basic connection and usage
4548
"""
49+
cluster_name = '{}-{}'.format(
50+
self.__class__.__name__, dse_version.base_version.replace('.', '_')
51+
)
52+
use_cluster(cluster_name=cluster_name, nodes=[3],
53+
dse_cluster=True, dse_options={}, dse_version=dse_version)
4654

47-
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
55+
cluster = Cluster()
4856
session = cluster.connect()
4957
result = execute_until_pass(
5058
session,

0 commit comments

Comments
 (0)