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


Python MatchesStructure.fromExample方法代码示例

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


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

示例1: test_if_message_given_message

# 需要导入模块: from testtools.matchers import MatchesStructure [as 别名]
# 或者: from testtools.matchers.MatchesStructure import fromExample [as 别名]
 def test_if_message_given_message(self):
     # Annotate.if_message returns an annotated version of the matcher if a
     # message is provided.
     matcher = Equals(1)
     expected = Annotate("foo", matcher)
     annotated = Annotate.if_message("foo", matcher)
     self.assertThat(annotated, MatchesStructure.fromExample(expected, "annotation", "matcher"))
开发者ID:brantlk,项目名称:testtools,代码行数:9,代码来源:test_higherorder.py

示例2: test_DDEBsGetOverrideFromDEBs

# 需要导入模块: from testtools.matchers import MatchesStructure [as 别名]
# 或者: from testtools.matchers.MatchesStructure import fromExample [as 别名]
    def test_DDEBsGetOverrideFromDEBs(self):
        # Test the basic case ensuring that DDEB files always match the
        # DEB's overrides.
        deb = self.addFile("foo_1.0_i386.deb", "main/devel", "extra")
        ddeb = self.addFile("foo-dbgsym_1.0_i386.ddeb", "universe/web", "low")
        self.assertMatchDDEBErrors([])
        self.upload._overrideDDEBSs()

        self.assertThat(ddeb, MatchesStructure.fromExample(deb, "component_name", "section_name", "priority_name"))
开发者ID:vitaminmoo,项目名称:unnaturalcode,代码行数:11,代码来源:test_nascentupload.py

示例3: test_getConfigs_maps_distro_and_purpose_to_matching_config

# 需要导入模块: from testtools.matchers import MatchesStructure [as 别名]
# 或者: from testtools.matchers.MatchesStructure import fromExample [as 别名]
 def test_getConfigs_maps_distro_and_purpose_to_matching_config(self):
     distro = self.makeDistroWithPublishDirectory()
     script = self.makeScript(distro)
     script.setUp()
     reference_config = getPubConfig(distro.main_archive)
     config = script.getConfigs()[distro][ArchivePurpose.PRIMARY]
     self.assertThat(
         config, MatchesStructure.fromExample(
             reference_config, 'temproot', 'distroroot', 'archiveroot'))
开发者ID:pombreda,项目名称:UnnaturalCodeFork,代码行数:11,代码来源:test_publish_ftpmaster.py

示例4: test_fromExample

# 需要导入模块: from testtools.matchers import MatchesStructure [as 别名]
# 或者: from testtools.matchers.MatchesStructure import fromExample [as 别名]
 def test_fromExample(self):
     self.assertThat(
         self.SimpleClass(1, 2),
         MatchesStructure.fromExample(self.SimpleClass(1, 3), 'x'))
开发者ID:atlant2011,项目名称:samba,代码行数:6,代码来源:test_matchers.py


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