当前位置: 首页>>代码示例>>Python>>正文


Python Attr.size方法代码示例

本文整理汇总了Python中boto3.dynamodb.conditions.Attr.size方法的典型用法代码示例。如果您正苦于以下问题:Python Attr.size方法的具体用法?Python Attr.size怎么用?Python Attr.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boto3.dynamodb.conditions.Attr的用法示例。


在下文中一共展示了Attr.size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestA

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [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))
开发者ID:mtdowling,项目名称:boto3,代码行数:29,代码来源:test_conditions.py

示例2: test_build_size_with_other_conditons

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [as 别名]
 def test_build_size_with_other_conditons(self):
     a = Attr('myattr')
     self.assert_condition_expression_build(
         a.size().eq(5), 'size(#n0) = :v0', {'#n0': 'myattr'}, {':v0': 5})
开发者ID:boto,项目名称:boto3,代码行数:6,代码来源:test_conditions.py

示例3: test_build_size

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [as 别名]
 def test_build_size(self):
     a = Attr('myattr')
     self.assert_condition_expression_build(
         a.size(), 'size(#n0)', {'#n0': 'myattr'}, {})
开发者ID:boto,项目名称:boto3,代码行数:6,代码来源:test_conditions.py

示例4: TestA

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [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)
开发者ID:boto,项目名称:boto3,代码行数:75,代码来源:test_conditions.py

示例5: test_build_size_with_other_conditons

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [as 别名]
 def test_build_size_with_other_conditons(self):
     a = Attr("myattr")
     self.assert_condition_expression_build(a.size().eq(5), "size(#n0) = :v0", {"#n0": "myattr"}, {":v0": 5})
开发者ID:mtdowling,项目名称:boto3,代码行数:5,代码来源:test_conditions.py

示例6: test_build_size

# 需要导入模块: from boto3.dynamodb.conditions import Attr [as 别名]
# 或者: from boto3.dynamodb.conditions.Attr import size [as 别名]
 def test_build_size(self):
     a = Attr("myattr")
     self.assert_condition_expression_build(a.size(), "size(#n0)", {"#n0": "myattr"}, {})
开发者ID:mtdowling,项目名称:boto3,代码行数:5,代码来源:test_conditions.py


注:本文中的boto3.dynamodb.conditions.Attr.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。