conftest.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:dynamorm 作者: NerdWalletOSS 项目源码 文件源码
def TestModelTwo():
    """Provides a test model without a range key"""

    if 'marshmallow' in (os.getenv('SERIALIZATION_PKG') or ''):
        from marshmallow import fields

        class TestModelTwo(DynaModel):
            class Table:
                name = 'peanut-butter'
                hash_key = 'foo'
                read = 5
                write = 5

            class Schema:
                foo = fields.String(required=True)
                bar = fields.String()
                baz = fields.String()
    else:
        from schematics import types

        class TestModelTwo(DynaModel):
            class Table:
                name = 'peanut-butter'
                hash_key = 'foo'
                read = 5
                write = 5

            class Schema:
                foo = types.StringType(required=True)
                bar = types.StringType()
                baz = types.StringType()

    return TestModelTwo
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号