本文整理汇总了Python中boto3.dynamodb.conditions.Attr.not_exists方法的典型用法代码示例。如果您正苦于以下问题:Python Attr.not_exists方法的具体用法?Python Attr.not_exists怎么用?Python Attr.not_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boto3.dynamodb.conditions.Attr
的用法示例。
在下文中一共展示了Attr.not_exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestA
# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import not_exists [as 别名]
class TestA(TestK):
def setUp(self):
self.attr = Attr("mykey")
self.attr2 = Attr("myotherkey")
self.value = "foo"
self.value2 = "foo2"
def test_ne(self):
self.assertEqual(self.attr.ne(self.value), NotEquals(self.attr, self.value))
def test_is_in(self):
self.assertEqual(self.attr.is_in([self.value]), In(self.attr, [self.value]))
def test_exists(self):
self.assertEqual(self.attr.exists(), AttributeExists(self.attr))
def test_not_exists(self):
self.assertEqual(self.attr.not_exists(), AttributeNotExists(self.attr))
def test_contains(self):
self.assertEqual(self.attr.contains(self.value), Contains(self.attr, self.value))
def test_size(self):
self.assertEqual(self.attr.size(), Size(self.attr))
def test_attribute_type(self):
self.assertEqual(self.attr.attribute_type(self.value), AttributeType(self.attr, self.value))
示例2: test_build_expression_not_exists
# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import not_exists [as 别名]
def test_build_expression_not_exists(self):
a = Attr('myattr')
self.assert_condition_expression_build(
a.not_exists(), 'attribute_not_exists(#n0)', {'#n0': 'myattr'}, {})
示例3: TestA
# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import not_exists [as 别名]
class TestA(TestK):
def setUp(self):
self.attr = Attr('mykey')
self.attr2 = Attr('myotherkey')
self.value = 'foo'
self.value2 = 'foo2'
def test_ne(self):
self.assertEqual(self.attr.ne(self.value),
NotEquals(self.attr, self.value))
def test_is_in(self):
self.assertEqual(self.attr.is_in([self.value]),
In(self.attr, [self.value]))
def test_exists(self):
self.assertEqual(self.attr.exists(), AttributeExists(self.attr))
def test_not_exists(self):
self.assertEqual(self.attr.not_exists(), AttributeNotExists(self.attr))
def test_contains(self):
self.assertEqual(self.attr.contains(self.value),
Contains(self.attr, self.value))
def test_size(self):
self.assertEqual(self.attr.size(), Size(self.attr))
def test_attribute_type(self):
self.assertEqual(self.attr.attribute_type(self.value),
AttributeType(self.attr, self.value))
def test_ne_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.ne(self.value)
comp2 = attr_copy.ne(self.value)
self.assertEqual(comp, comp2)
def test_is_in_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.is_in([self.value])
comp2 = attr_copy.is_in([self.value])
self.assertEqual(comp, comp2)
def test_exists_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.exists()
comp2 = attr_copy.exists()
self.assertEqual(comp, comp2)
def test_not_exists_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.not_exists()
comp2 = attr_copy.not_exists()
self.assertEqual(comp, comp2)
def test_contains_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.contains(self.value)
comp2 = attr_copy.contains(self.value)
self.assertEqual(comp, comp2)
def test_size_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.size()
comp2 = attr_copy.size()
self.assertEqual(comp, comp2)
def test_attribute_type_equality(self):
attr_copy = copy.deepcopy(self.attr)
comp = self.attr.attribute_type(self.value)
comp2 = attr_copy.attribute_type(self.value)
self.assertEqual(comp, comp2)
示例4: test_build_expression_not_exists
# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import not_exists [as 别名]
def test_build_expression_not_exists(self):
a = Attr("myattr")
self.assert_condition_expression_build(a.not_exists(), "attribute_not_exists(#n0)", {"#n0": "myattr"}, {})