Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'thobbs/add-0.8-calls' into multiversion-plus-0.8

  • Loading branch information...
commit ad0499ae08f7073076609c64cf06ffcce5e1ac26 2 parents f93f449 + 4068d34
@thepaul thepaul authored
Showing with 19 additions and 2 deletions.
  1. +19 −2 test/test_cassandraclient.py
View
21 test/test_cassandraclient.py
@@ -5,6 +5,7 @@
from telephus.client import CassandraClient
from telephus.cassandra import constants
from telephus.cassandra.ttypes import *
+from telephus.translate import getAPIVersion
import os
import zlib
@@ -37,6 +38,9 @@ def setUp(self):
reactor.connectTCP(HOST, PORT, self.cmanager)
yield self.cmanager.deferred
+ remote_ver = yield self.client.describe_version()
+ self.version = getAPIVersion(remote_ver)
+
self.my_keyspace = KsDef(
name=KEYSPACE,
strategy_class='org.apache.cassandra.locator.SimpleStrategy',
@@ -66,6 +70,10 @@ def setUp(self):
],
default_validation_class='org.apache.cassandra.db.marshal.BytesType'
),
+ ]
+ )
+ if self.version == constants.CASSANDRA_08:
+ self.my_keyspace.cf_defs.extend([
CfDef(
keyspace=KEYSPACE,
name=COUNTER_CF,
@@ -78,8 +86,8 @@ def setUp(self):
column_type='Super',
default_validation_class='org.apache.cassandra.db.marshal.CounterColumnType'
),
- ]
- )
+ ])
+
yield self.client.system_add_keyspace(self.my_keyspace)
yield self.client.set_keyspace(KEYSPACE)
@@ -193,6 +201,9 @@ def test_indexed_slices(self):
@defer.inlineCallbacks
def test_counter_add(self):
+ if self.version != constants.CASSANDRA_08:
+ raise unittest.SkipTest('Counters are not supported in 0.7')
+
# test standard column counter
yield self.client.add('test', COUNTER_CF, 1, column='col')
res = yield self.client.get('test', COUNTER_CF, column='col')
@@ -213,6 +224,9 @@ def test_counter_add(self):
@defer.inlineCallbacks
def test_counter_remove(self):
+ if self.version != constants.CASSANDRA_08:
+ raise unittest.SkipTest('Counters are not supported in 0.7')
+
# test standard column counter
yield self.client.add('test', COUNTER_CF, 1, column='col')
res = yield self.client.get('test', COUNTER_CF, column='col')
@@ -235,6 +249,9 @@ def test_counter_remove(self):
@defer.inlineCallbacks
def test_cql(self):
+ if self.version != constants.CASSANDRA_08:
+ raise unittest.SkipTest('CQL is not supported in 0.7')
+
yield self.client.insert('test', CF, 'testval', column='col1')
res = yield self.client.get('test', CF, column='col1')
self.assertEquals(res.column.value, 'testval')
Please sign in to comment.
Something went wrong with that request. Please try again.