|
28 | 28 |
|
29 | 29 | from cassandra.cluster import Cluster
|
30 | 30 | from cassandra.encoder import Encoder
|
31 |
| -from cassandra.metadata import (IndexMetadata, Token, murmur3, Function, Aggregate, protect_name, protect_names, |
| 31 | +from cassandra.metadata import (IndexMetadata, Token, murmur3, Function, Aggregate, protect_name, protect_names, |
32 | 32 | RegisteredTableExtension, _RegisteredExtensionType, get_schema_parser,
|
33 | 33 | group_keys_by_replica, NO_VALID_REPLICA)
|
34 | 34 |
|
|
40 | 40 |
|
41 | 41 | from tests.integration import greaterthancass21
|
42 | 42 |
|
| 43 | + |
43 | 44 | def setup_module():
|
44 | 45 | use_singledc()
|
45 | 46 |
|
@@ -79,11 +80,12 @@ def test_host_release_version(self):
|
79 | 80 | for host in self.cluster.metadata.all_hosts():
|
80 | 81 | self.assertTrue(host.release_version.startswith(CASSANDRA_VERSION.base_version))
|
81 | 82 |
|
| 83 | + |
82 | 84 | @local
|
83 | 85 | class MetaDataRemovalTest(unittest.TestCase):
|
84 | 86 |
|
85 | 87 | def setUp(self):
|
86 |
| - self.cluster = Cluster(protocol_version=PROTOCOL_VERSION, contact_points=['127.0.0.1','127.0.0.2', '127.0.0.3', '126.0.0.186']) |
| 88 | + self.cluster = Cluster(protocol_version=PROTOCOL_VERSION, contact_points=['127.0.0.1', '127.0.0.2', '127.0.0.3', '126.0.0.186']) |
87 | 89 | self.cluster.connect()
|
88 | 90 |
|
89 | 91 | def tearDown(self):
|
@@ -1912,7 +1914,10 @@ def test_dct_alias(self):
|
1912 | 1914 | dct_table = self.cluster.metadata.keyspaces.get(self.ks_name).tables.get(self.function_table_name)
|
1913 | 1915 |
|
1914 | 1916 | # Format can very slightly between versions, strip out whitespace for consistency sake
|
1915 |
| - self.assertTrue("c1'org.apache.cassandra.db.marshal.DynamicCompositeType(s=>org.apache.cassandra.db.marshal.UTF8Type,i=>org.apache.cassandra.db.marshal.Int32Type)'" in dct_table.as_cql_query().replace(" ", "")) |
| 1917 | + self.assertTrue("c1'org.apache.cassandra.db.marshal.DynamicCompositeType(" |
| 1918 | + "s=>org.apache.cassandra.db.marshal.UTF8Type," |
| 1919 | + "i=>org.apache.cassandra.db.marshal.Int32Type)'" |
| 1920 | + in dct_table.as_cql_query().replace(" ", "")) |
1916 | 1921 |
|
1917 | 1922 |
|
1918 | 1923 | @greaterthanorequalcass30
|
@@ -1963,7 +1968,7 @@ def test_materialized_view_metadata_alter(self):
|
1963 | 1968 |
|
1964 | 1969 | @test_category metadata
|
1965 | 1970 | """
|
1966 |
| - self.assertIn("SizeTieredCompactionStrategy", self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views["mv1"].options["compaction"]["class"] ) |
| 1971 | + self.assertIn("SizeTieredCompactionStrategy", self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views["mv1"].options["compaction"]["class"]) |
1967 | 1972 |
|
1968 | 1973 | self.session.execute("ALTER MATERIALIZED VIEW {0}.mv1 WITH compaction = {{ 'class' : 'LeveledCompactionStrategy' }}".format(self.keyspace_name))
|
1969 | 1974 | self.assertIn("LeveledCompactionStrategy", self.cluster.metadata.keyspaces[self.keyspace_name].tables[self.function_table_name].views["mv1"].options["compaction"]["class"])
|
@@ -2295,6 +2300,7 @@ def test_metadata_with_quoted_identifiers(self):
|
2295 | 2300 | self.assertIsNotNone(value_column)
|
2296 | 2301 | self.assertEqual(value_column.name, 'the Value')
|
2297 | 2302 |
|
| 2303 | + |
2298 | 2304 | class GroupPerHost(BasicSharedKeyspaceUnitTestCase):
|
2299 | 2305 | @classmethod
|
2300 | 2306 | def setUpClass(cls):
|
@@ -2339,5 +2345,5 @@ def _assert_group_keys_by_host(self, keys, table_name, stmt):
|
2339 | 2345 | for key in keys:
|
2340 | 2346 | routing_key = prepared_stmt.bind(key).routing_key
|
2341 | 2347 | hosts = self.cluster.metadata.get_replicas(self.ks_name, routing_key)
|
2342 |
| - self.assertEqual(1, len(hosts)) # RF is 1 for this keyspace |
| 2348 | + self.assertEqual(1, len(hosts)) # RF is 1 for this keyspace |
2343 | 2349 | self.assertIn(key, keys_per_host[hosts[0]])
|
0 commit comments