12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- try :
16
- import unittest2 as unittest
17
- except ImportError :
18
- import unittest # noqa
15
+ import os
19
16
17
+ from packaging .version import Version
20
18
21
19
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 ,
25
22
execute_with_long_wait_retry , use_cluster )
26
23
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
32
28
33
29
30
+ @unittest .skipIf (os .environ .get ('CCM_ARGS' , None ), 'environment has custom CCM_ARGS; skipping' )
34
31
@notwindows
35
32
class DseCCMClusterTest (unittest .TestCase ):
36
33
"""
@@ -39,12 +36,23 @@ class DseCCMClusterTest(unittest.TestCase):
39
36
If CASSANDRA_VERSION is set instead, it will be converted to the corresponding DSE_VERSION
40
37
"""
41
38
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 ):
43
46
"""
44
47
Test basic connection and usage
45
48
"""
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 )
46
54
47
- cluster = Cluster (protocol_version = PROTOCOL_VERSION )
55
+ cluster = Cluster ()
48
56
session = cluster .connect ()
49
57
result = execute_until_pass (
50
58
session ,
0 commit comments