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


Python PortFactory.baseline_path方法代码示例

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


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

示例1: Rebaseliner

# 需要导入模块: from webkitpy.layout_tests.port.factory import PortFactory [as 别名]
# 或者: from webkitpy.layout_tests.port.factory.PortFactory import baseline_path [as 别名]

#.........这里部分代码省略.........

        Returns:
          List of tests that have been rebaselined or None on failure."""
        zip_namelist = zip_file.namelist()

        _log.debug("zip file namelist:")
        for name in zip_namelist:
            _log.debug("  " + name)

        _log.debug('Platform dir: "%s"', self._platform)

        self._rebaselined_tests = []
        for test_no, test in enumerate(self._rebaselining_tests):
            _log.debug("Test %d: %s", test_no + 1, test)
            self._extract_and_add_new_baseline(test, zip_file)

    def _extract_and_add_new_baseline(self, test, zip_file):
        found = False
        scm_error = False
        test_basename = self._filesystem.splitext(test)[0]
        for suffix in BASELINE_SUFFIXES:
            archive_test_name = "layout-test-results/%s-actual%s" % (test_basename, suffix)
            _log.debug('  Archive test file name: "%s"', archive_test_name)
            if not archive_test_name in zip_file.namelist():
                _log.debug("  %s file not in archive.", suffix)
                continue

            found = True
            _log.debug("  %s file found in archive.", suffix)

            temp_name = self._extract_from_zip_to_tempfile(zip_file, archive_test_name)

            expected_filename = "%s-expected%s" % (test_basename, suffix)
            expected_fullpath = self._filesystem.join(self._rebaseline_port.baseline_path(), expected_filename)
            expected_fullpath = self._filesystem.normpath(expected_fullpath)
            _log.debug('  Expected file full path: "%s"', expected_fullpath)

            relpath = self._filesystem.relpath(expected_fullpath, self._target_port.layout_tests_dir())

            # TODO(victorw): for now, the rebaselining tool checks whether
            # or not THIS baseline is duplicate and should be skipped.
            # We could improve the tool to check all baselines in upper
            # and lower levels and remove all duplicated baselines.
            if self._is_dup_baseline(temp_name, expected_fullpath, test, suffix, self._platform):
                self._filesystem.remove(temp_name)
                if self._filesystem.exists(expected_fullpath):
                    _log.info("  Removing %s" % relpath)
                    self._delete_baseline(expected_fullpath)
                _log.debug("  %s is a duplicate" % relpath)

                # FIXME: We consider a duplicate baseline a success in the normal case.
                # FIXME: This may not be what you want sometimes; should this be
                # FIXME: controllable?
                self._rebaselined_tests.append(test)
                continue

            if suffix == ".checksum" and self._png_has_same_checksum(temp_name, test, expected_fullpath):
                self._filesystem.remove(temp_name)
                # If an old checksum exists, delete it.
                self._delete_baseline(expected_fullpath)
                continue

            self._filesystem.maybe_make_directory(self._filesystem.dirname(expected_fullpath))
            self._filesystem.move(temp_name, expected_fullpath)

            path_from_base = self._filesystem.relpath(expected_fullpath)
开发者ID:,项目名称:,代码行数:70,代码来源:

示例2: _assert_baseline_path

# 需要导入模块: from webkitpy.layout_tests.port.factory import PortFactory [as 别名]
# 或者: from webkitpy.layout_tests.port.factory.PortFactory import baseline_path [as 别名]
 def _assert_baseline_path(self, port_name, baseline_path):
     port = PortFactory(MockSystemHost()).get(port_name)
     self.assertEquals(port.name(), port_name)
     self.assertEquals(port.baseline_path(), port._webkit_baseline_path(baseline_path))
开发者ID:,项目名称:,代码行数:6,代码来源:


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