Fix NetworkTopologyStrategy.export_for_schema()
Fixes PYTHON-120
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2.1.1
|
||||||
|
=====
|
||||||
|
In Progress
|
||||||
|
|
||||||
|
Bug Fixes
|
||||||
|
---------
|
||||||
|
* Fix NetworkTopologyStrategy.export_for_schema (PYTHON-120)
|
||||||
|
|
||||||
2.1.0
|
2.1.0
|
||||||
=====
|
=====
|
||||||
August 7, 2014
|
August 7, 2014
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ class NetworkTopologyStrategy(ReplicationStrategy):
|
|||||||
suitable for use in a CREATE KEYSPACE statement.
|
suitable for use in a CREATE KEYSPACE statement.
|
||||||
"""
|
"""
|
||||||
ret = "{'class': 'NetworkTopologyStrategy'"
|
ret = "{'class': 'NetworkTopologyStrategy'"
|
||||||
for dc, repl_factor in self.dc_replication_factors:
|
for dc, repl_factor in sorted(self.dc_replication_factors.items()):
|
||||||
ret += ", '%s': '%d'" % (dc, repl_factor)
|
ret += ", '%s': '%d'" % (dc, repl_factor)
|
||||||
return ret + "}"
|
return ret + "}"
|
||||||
|
|
||||||
|
|||||||
@@ -127,8 +127,9 @@ class TestStrategies(unittest.TestCase):
|
|||||||
self.assertEqual(set(replica_map[MD5Token(0)]), set([host]))
|
self.assertEqual(set(replica_map[MD5Token(0)]), set([host]))
|
||||||
|
|
||||||
def test_nts_export_for_schema(self):
|
def test_nts_export_for_schema(self):
|
||||||
# TODO: Cover NetworkTopologyStrategy.export_for_schema()
|
strategy = NetworkTopologyStrategy({'dc1': '1', 'dc2': '2'})
|
||||||
pass
|
self.assertEqual("{'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '2'}",
|
||||||
|
strategy.export_for_schema())
|
||||||
|
|
||||||
def test_simple_strategy_make_token_replica_map(self):
|
def test_simple_strategy_make_token_replica_map(self):
|
||||||
host1 = Host('1', SimpleConvictionPolicy)
|
host1 = Host('1', SimpleConvictionPolicy)
|
||||||
|
|||||||
Reference in New Issue
Block a user