Skip to content

Commit 9aaf1ec

Browse files
committed
whitespace fixes pre-PYTHON-761
1 parent a83f3dd commit 9aaf1ec

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

cassandra/policies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ class WriteType(object):
619619
A lighweight-transaction write, such as "DELETE ... IF EXISTS".
620620
"""
621621

622+
622623
WriteType.name_to_value = {
623624
'SIMPLE': WriteType.SIMPLE,
624625
'BATCH': WriteType.BATCH,

tests/integration/long/test_loadbalancingpolicies.py

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

15-
import struct, time, logging, sys, traceback
15+
import logging
16+
import struct
17+
import sys
18+
import traceback
1619

1720
from cassandra import ConsistencyLevel, Unavailable, OperationTimedOut, ReadTimeout, ReadFailure, \
1821
WriteTimeout, WriteFailure
19-
from cassandra.cluster import Cluster, NoHostAvailable, ExecutionProfile
22+
from cassandra.cluster import Cluster, NoHostAvailable
2023
from cassandra.concurrent import execute_concurrent_with_args
2124
from cassandra.metadata import murmur3
2225
from cassandra.policies import (RoundRobinPolicy, DCAwareRoundRobinPolicy,
@@ -40,7 +43,7 @@
4043
class LoadBalancingPolicyTests(unittest.TestCase):
4144

4245
def setUp(self):
43-
remove_cluster() # clear ahead of test so it doesn't use one left in unknown state
46+
remove_cluster() # clear ahead of test so it doesn't use one left in unknown state
4447
self.coordinator_stats = CoordinatorStats()
4548
self.prepared = None
4649
self.probe_cluster = None
@@ -105,7 +108,7 @@ def _query(self, session, keyspace, count=12,
105108
query_string = 'SELECT * FROM %s.cf WHERE k = ?' % keyspace
106109
if not self.prepared or self.prepared.query_string != query_string:
107110
self.prepared = session.prepare(query_string)
108-
self.prepared.consistency_level=consistency_level
111+
self.prepared.consistency_level = consistency_level
109112
for i in range(count):
110113
tries = 0
111114
while True:
@@ -508,7 +511,7 @@ def test_token_aware_with_rf_2(self, use_prepared=False):
508511

509512
self.coordinator_stats.reset_counts()
510513
stop(2)
511-
self._wait_for_nodes_down([2],cluster)
514+
self._wait_for_nodes_down([2], cluster)
512515

513516
self._query(session, keyspace)
514517

tests/unit/test_policies.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ def test_modification_during_generation(self):
421421
policy.on_up(hosts[2])
422422
policy.on_up(hosts[3])
423423

424-
425424
another_host = Host(5, SimpleConvictionPolicy)
426425
another_host.set_location_info("dc3", "rack1")
427426
new_host.set_location_info("dc3", "rack1")
@@ -755,7 +754,7 @@ def test_no_shuffle_if_given_no_keyspace(self):
755754
@test_category policy
756755
"""
757756
self._assert_shuffle(keyspace=None, routing_key='routing_key')
758-
757+
759758
def test_no_shuffle_if_given_no_routing_key(self):
760759
"""
761760
Test to validate the hosts are not shuffled when no routing_key is provided
@@ -766,7 +765,7 @@ def test_no_shuffle_if_given_no_routing_key(self):
766765
@test_category policy
767766
"""
768767
self._assert_shuffle(keyspace='keyspace', routing_key=None)
769-
768+
770769
@patch('cassandra.policies.shuffle')
771770
def _assert_shuffle(self, patched_shuffle, keyspace, routing_key):
772771
hosts = [Host(str(i), SimpleConvictionPolicy) for i in range(4)]
@@ -884,7 +883,7 @@ def test_bad_vals(self):
884883
self.assertRaises(ValueError, ExponentialReconnectionPolicy, -1, 0)
885884
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 0, -1)
886885
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 9000, 1)
887-
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 1, 2,-1)
886+
self.assertRaises(ValueError, ExponentialReconnectionPolicy, 1, 2, -1)
888887

889888
def test_schedule_no_max(self):
890889
base_delay = 2.0
@@ -1235,8 +1234,7 @@ def test_hosts_with_hostname(self):
12351234
class AddressTranslatorTest(unittest.TestCase):
12361235

12371236
def test_identity_translator(self):
1238-
it = IdentityTranslator()
1239-
addr = '127.0.0.1'
1237+
IdentityTranslator()
12401238

12411239
@patch('socket.getfqdn', return_value='localhost')
12421240
def test_ec2_multi_region_translator(self, *_):

0 commit comments

Comments
 (0)