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


Python Wrapper.docs方法代码示例

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


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

示例1: test_caching

# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import docs [as 别名]
def test_caching():
    with tempdir():
        wrapper1 = Wrapper()

        with open("abc.txt", "w") as f:
            f.write("these are the contents")

        doc1 = Doc("abc.txt|dexy", wrapper=wrapper1)
        wrapper1.docs = [doc1]
        wrapper1.run()

        assert isinstance(doc1.artifacts[0], InitialArtifact)
        hashstring_0_1 = doc1.artifacts[0].hashstring

        assert isinstance(doc1.artifacts[1], FilterArtifact)
        hashstring_1_1 = doc1.artifacts[1].hashstring

        wrapper2 = Wrapper()
        doc2 = Doc("abc.txt|dexy", wrapper=wrapper2)
        wrapper2.docs = [doc2]
        wrapper2.run()

        assert isinstance(doc2.artifacts[0], InitialArtifact)
        hashstring_0_2 = doc2.artifacts[0].hashstring

        assert isinstance(doc2.artifacts[1], FilterArtifact)
        hashstring_1_2 = doc2.artifacts[1].hashstring

        assert hashstring_0_1 == hashstring_0_2
        assert hashstring_1_1 == hashstring_1_2
开发者ID:adityaathalye,项目名称:dexy,代码行数:32,代码来源:test_artifact.py

示例2: test_caching_virtual_file

# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import docs [as 别名]
def test_caching_virtual_file():
    with tempdir():
        wrapper1 = Wrapper()
        doc1 = Doc("abc.txt|dexy",
                contents = "these are the contents",
                wrapper=wrapper1)
        wrapper1.docs = [doc1]
        wrapper1.run()

        assert isinstance(doc1.artifacts[0], InitialVirtualArtifact)
        hashstring_0_1 = doc1.artifacts[0].hashstring

        assert isinstance(doc1.artifacts[1], FilterArtifact)
        hashstring_1_1 = doc1.artifacts[1].hashstring

        wrapper2 = Wrapper()
        doc2 = Doc(
                "abc.txt|dexy",
                contents = "these are the contents",
                wrapper=wrapper2)
        wrapper2.docs = [doc2]
        wrapper2.run()

        assert isinstance(doc2.artifacts[0], InitialVirtualArtifact)
        hashstring_0_2 = doc2.artifacts[0].hashstring

        assert isinstance(doc2.artifacts[1], FilterArtifact)
        hashstring_1_2 = doc2.artifacts[1].hashstring

        assert hashstring_0_1 == hashstring_0_2
        assert hashstring_1_1 == hashstring_1_2
开发者ID:adityaathalye,项目名称:dexy,代码行数:33,代码来源:test_artifact.py

示例3: test_wrapper_run

# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import docs [as 别名]
def test_wrapper_run():
    with tempdir():
        wrapper = Wrapper()
        wrapper.setup_dexy_dirs()
        d1 = Doc("abc.txt|outputabc", contents="these are the contents", wrapper=wrapper)
        d2 = Doc("hello.txt|outputabc", contents="these are more contents", wrapper=wrapper)
        assert d1.state == 'setup'
        assert d2.state == 'setup'
        wrapper.docs = [d1, d2]
        wrapper.run()
        assert d1.state == 'complete'
        assert d2.state == 'complete'
开发者ID:adityaathalye,项目名称:dexy,代码行数:14,代码来源:test_runner.py


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