Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Skip tests that can't be performed with RandomPartitioner

  • Loading branch information...
commit dd3c7f04058a1112de840e623856e5383e7da139 1 parent 4b88b9a
@thobbs thobbs authored
Showing with 19 additions and 4 deletions.
  1. +11 −2 tests/test_columnfamily.py
  2. +8 −2 tests/test_columnfamilymap.py
View
13 tests/test_columnfamily.py
@@ -1,17 +1,20 @@
-from pycassa import index, ColumnFamily, ConsistencyLevel, ConnectionPool, NotFoundException
+from pycassa import index, ColumnFamily, ConsistencyLevel, ConnectionPool,\
+ NotFoundException, SystemManager
from nose.tools import assert_raises, assert_equal, assert_true
+from nose.plugins.skip import *
import struct
import unittest
def setup_module():
- global pool, cf, scf, indexed_cf
+ global pool, cf, scf, indexed_cf, sys_man
credentials = {'username': 'jsmith', 'password': 'havebadpass'}
pool = ConnectionPool(keyspace='PycassaTestKeyspace', credentials=credentials)
cf = ColumnFamily(pool, 'Standard1', dict_class=TestDict)
scf = ColumnFamily(pool, 'Super1', dict_class=TestDict)
indexed_cf = ColumnFamily(pool, 'Indexed1')
+ sys_man = SystemManager()
def teardown_module():
pool.dispose()
@@ -104,6 +107,9 @@ def test_insert_multiget_count(self):
assert_equal(result[keys[0]], 1)
def test_insert_get_range(self):
+ if sys_man.describe_partitioner() == 'RandomPartitioner':
+ raise SkipTest('Cannot use RandomPartitioner for this test')
+
keys = ['TestColumnFamily.test_insert_get_range%s' % i for i in xrange(5)]
columns = {'1': 'val1', '2': 'val2'}
for key in keys:
@@ -116,6 +122,9 @@ def test_insert_get_range(self):
assert_equal(c, columns)
def test_get_range_batching(self):
+ if sys_man.describe_partitioner() == 'RandomPartitioner':
+ raise SkipTest('Cannot use RandomPartitioner for this test')
+
cf.truncate()
keys = []
View
10 tests/test_columnfamilymap.py
@@ -2,18 +2,21 @@
from pycassa import index, ColumnFamily, ConnectionPool, \
ColumnFamilyMap, ConsistencyLevel, NotFoundException, String, Int64, \
- Float64, DateTime, IntString, FloatString, DateTimeString
+ Float64, DateTime, IntString, FloatString, DateTimeString, \
+ SystemManager
from nose.tools import assert_raises, assert_equal, assert_true
+from nose.plugins.skip import *
import struct
def setup_module():
- global pool, cf, scf, indexed_cf
+ global pool, cf, scf, indexed_cf, sys_man
credentials = {'username': 'jsmith', 'password': 'havebadpass'}
pool = ConnectionPool(keyspace='PycassaTestKeyspace', credentials=credentials)
cf = ColumnFamily(pool, 'Standard1', autopack_names=False, autopack_values=False)
scf = ColumnFamily(pool, 'Super1', autopack_names=False, autopack_values=False)
indexed_cf = ColumnFamily(pool, 'Indexed1', autopack_names=False, autopack_values=False)
+ sys_man = SystemManager()
def teardown_module():
pool.dispose()
@@ -118,6 +121,9 @@ def test_insert_get_count(self):
assert_equal(self.map.get_count(instance.key), 7)
def test_insert_get_range(self):
+ if sys_man.describe_partitioner() == 'RandomPartitioner':
+ raise SkipTest('Cannot use RandomPartitioner for this test')
+
instances = []
for i in xrange(5):
instance = self.instance('TestColumnFamilyMap.test_insert_get_range%s' % i)
Please sign in to comment.
Something went wrong with that request. Please try again.