whitespace fixes pre-PYTHON-761

This commit is contained in:
Jim Witschey 2017-05-26 12:05:32 -04:00
parent a83f3dd191
commit 9aaf1ec532
3 changed files with 13 additions and 11 deletions

View File

@ -619,6 +619,7 @@ class WriteType(object):
A lighweight-transaction write, such as "DELETE ... IF EXISTS".
"""
WriteType.name_to_value = {
'SIMPLE': WriteType.SIMPLE,
'BATCH': WriteType.BATCH,

View File

@ -12,11 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import struct, time, logging, sys, traceback
import logging
import struct
import sys
import traceback
from cassandra import ConsistencyLevel, Unavailable, OperationTimedOut, ReadTimeout, ReadFailure, \
WriteTimeout, WriteFailure
from cassandra.cluster import Cluster, NoHostAvailable, ExecutionProfile
from cassandra.cluster import Cluster, NoHostAvailable
from cassandra.concurrent import execute_concurrent_with_args
from cassandra.metadata import murmur3
from cassandra.policies import (RoundRobinPolicy, DCAwareRoundRobinPolicy,
@ -40,7 +43,7 @@ log = logging.getLogger(__name__)
class LoadBalancingPolicyTests(unittest.TestCase):
def setUp(self):
remove_cluster() # clear ahead of test so it doesn't use one left in unknown state
remove_cluster() # clear ahead of test so it doesn't use one left in unknown state
self.coordinator_stats = CoordinatorStats()
self.prepared = None
self.probe_cluster = None
@ -105,7 +108,7 @@ class LoadBalancingPolicyTests(unittest.TestCase):
query_string = 'SELECT * FROM %s.cf WHERE k = ?' % keyspace
if not self.prepared or self.prepared.query_string != query_string:
self.prepared = session.prepare(query_string)
self.prepared.consistency_level=consistency_level
self.prepared.consistency_level = consistency_level
for i in range(count):
tries = 0
while True:
@ -508,7 +511,7 @@ class LoadBalancingPolicyTests(unittest.TestCase):
self.coordinator_stats.reset_counts()
stop(2)
self._wait_for_nodes_down([2],cluster)
self._wait_for_nodes_down([2], cluster)
self._query(session, keyspace)

View File

@ -421,7 +421,6 @@ class DCAwareRoundRobinPolicyTest(unittest.TestCase):
policy.on_up(hosts[2])
policy.on_up(hosts[3])
another_host = Host(5, SimpleConvictionPolicy)
another_host.set_location_info("dc3", "rack1")
new_host.set_location_info("dc3", "rack1")
@ -755,7 +754,7 @@ class TokenAwarePolicyTest(unittest.TestCase):
@test_category policy
"""
self._assert_shuffle(keyspace=None, routing_key='routing_key')
def test_no_shuffle_if_given_no_routing_key(self):
"""
Test to validate the hosts are not shuffled when no routing_key is provided
@ -766,7 +765,7 @@ class TokenAwarePolicyTest(unittest.TestCase):
@test_category policy
"""
self._assert_shuffle(keyspace='keyspace', routing_key=None)
@patch('cassandra.policies.shuffle')
def _assert_shuffle(self, patched_shuffle, keyspace, routing_key):
hosts = [Host(str(i), SimpleConvictionPolicy) for i in range(4)]
@ -884,7 +883,7 @@ class ExponentialReconnectionPolicyTest(unittest.TestCase):
self.assertRaises(ValueError, ExponentialReconnectionPolicy, -1, 0)
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 0, -1)
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 9000, 1)
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 1, 2,-1)
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 1, 2, -1)
def test_schedule_no_max(self):
base_delay = 2.0
@ -1235,8 +1234,7 @@ class WhiteListRoundRobinPolicyTest(unittest.TestCase):
class AddressTranslatorTest(unittest.TestCase):
def test_identity_translator(self):
it = IdentityTranslator()
addr = '127.0.0.1'
IdentityTranslator()
@patch('socket.getfqdn', return_value='localhost')
def test_ec2_multi_region_translator(self, *_):