本文整理汇总了Python中pycassa.columnfamily.ColumnFamily.column_validators[("a","b")]方法的典型用法代码示例。如果您正苦于以下问题:Python ColumnFamily.column_validators[("a","b")]方法的具体用法?Python ColumnFamily.column_validators[("a","b")]怎么用?Python ColumnFamily.column_validators[("a","b")]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycassa.columnfamily.ColumnFamily
的用法示例。
在下文中一共展示了ColumnFamily.column_validators[("a","b")]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_column_validator
# 需要导入模块: from pycassa.columnfamily import ColumnFamily [as 别名]
# 或者: from pycassa.columnfamily.ColumnFamily import column_validators[("a","b")] [as 别名]
def test_column_validator(self):
cf = ColumnFamily(pool, "CompositeOverrideCF")
cf.column_validators[("a", "b")] = BooleanType()
cf.insert("key", {("a", "a"): "foo", ("a", "b"): True})
assert_equal(cf.get("key"), {("a", "a"): "foo", ("a", "b"): True})
assert_equal(cf.column_validators[("a", "b")].__class__, BooleanType)
keys = cf.column_validators.keys()
assert_equal(keys, [("a", "b")])
del cf.column_validators[("a", "b")]
assert_raises(KeyError, cf.column_validators.__getitem__, ("a", "b"))