Skip to content

Commit 253279e

Browse files
committed
Review tweaks
PYTHON-231
1 parent 2dba082 commit 253279e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

cassandra/cqltypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ class MapType(_ParameterizedType):
780780

781781
@classmethod
782782
def validate(cls, val):
783-
key_type, subvaltype = cls.subtypes
784-
return dict((key_type.validate(k), subvaltype.validate(v)) for (k, v) in six.iteritems(val))
783+
key_type, value_type = cls.subtypes
784+
return dict((key_type.validate(k), value_type.validate(v)) for (k, v) in six.iteritems(val))
785785

786786
@classmethod
787787
def deserialize_safe(cls, byts, protocol_version):

tests/unit/test_policies.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
try:
1616
import unittest2 as unittest
1717
except ImportError:
18-
import unittest # noqa
18+
import unittest # noqa
1919

2020
from itertools import islice, cycle
2121
from mock import Mock
@@ -139,7 +139,7 @@ def host_down():
139139
threads.append(Thread(target=host_down))
140140

141141
# make the GIL switch after every instruction, maximizing
142-
# the chace of race conditions
142+
# the chance of race conditions
143143
check = six.PY2 or '__pypy__' in sys.builtin_module_names
144144
if check:
145145
original_interval = sys.getcheckinterval()
@@ -363,6 +363,7 @@ def test_default_dc(self):
363363
policy.on_add(host_remote)
364364
self.assertFalse(policy.local_dc)
365365

366+
366367
class TokenAwarePolicyTest(unittest.TestCase):
367368

368369
def test_wrap_round_robin(self):
@@ -520,7 +521,6 @@ def test_status_updates(self):
520521
qplan = list(policy.make_query_plan())
521522
self.assertEqual(qplan, [])
522523

523-
524524
def test_statement_keyspace(self):
525525
hosts = [Host(str(i), SimpleConvictionPolicy) for i in range(4)]
526526
for host in hosts:
@@ -667,6 +667,7 @@ def test_schedule(self):
667667

668668
ONE = ConsistencyLevel.ONE
669669

670+
670671
class RetryPolicyTest(unittest.TestCase):
671672

672673
def test_read_timeout(self):

0 commit comments

Comments
 (0)