cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r986846 - /cassandra/trunk/test/system/test_thrift_server.py
Date Wed, 18 Aug 2010 18:34:46 GMT
Author: jbellis
Date: Wed Aug 18 18:34:46 2010
New Revision: 986846

URL: http://svn.apache.org/viewvc?rev=986846&view=rev
Log:
add test for column validation in supercolumn.  patch by jhermes; reviewed by jbellis for
CASSANDRA-1388

Modified:
    cassandra/trunk/test/system/test_thrift_server.py

Modified: cassandra/trunk/test/system/test_thrift_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_thrift_server.py?rev=986846&r1=986845&r2=986846&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_thrift_server.py (original)
+++ cassandra/trunk/test/system/test_thrift_server.py Wed Aug 18 18:34:46 2010
@@ -1191,6 +1191,7 @@ class TestMutations(ThriftTester):
         client.system_drop_keyspace(keyspace.name)
 
     def test_column_validators(self):
+        # regular CF
         ks = 'Keyspace1'
         _set_keyspace(ks)
         cd = ColumnDef('col', 'LongType', None, None)
@@ -1206,6 +1207,18 @@ class TestMutations(ThriftTester):
         e = _expect_exception(lambda: client.insert('key1', cp, col1, ConsistencyLevel.ONE),
InvalidRequestException)
         assert e.why.find("failed validation") >= 0
 
+        # super CF
+        scf = CfDef('Keyspace1', 'ValidatorSuperColumnFamily', column_type='Super', column_metadata=[cd])
+        client.system_add_column_family(scf)
+        ks_def = client.describe_keyspace(ks)
+        assert 'ValidatorSuperColumnFamily' in [x.name for x in ks_def.cf_defs]
+
+        scp = ColumnParent('ValidatorSuperColumnFamily','sc1')
+        client.insert('key0', scp, col0, ConsistencyLevel.ONE)
+        e = _expect_exception(lambda: client.insert('key1', scp, col1, ConsistencyLevel.ONE),
InvalidRequestException)
+        assert e.why.find("failed validation") >= 0
+       
+
     def test_system_column_family_operations(self):
         _set_keyspace('Keyspace1')
         # create



Mime
View raw message