def test_baseline_name(self): fs = MockFileSystem() self.assertEqual(baseline_name(fs, 'x/y/foo.html', 'txt'), 'x/y/foo-expected.txt') self.assertEqual(baseline_name(fs, 'foo.html', 'txt'), 'foo-expected.txt') self.assertEqual(baseline_name(fs, 'foo', 'txt'), 'foo-expected.txt')
def _analyze_baseline(self, options, test_name): for suffix in self._baseline_suffix_list: name = baseline_name(self._tool.filesystem, test_name, suffix) results_by_directory = self._baseline_optimizer.read_results_by_directory(name) if results_by_directory: self._write("%s:" % name) self._baseline_optimizer.write_by_directory(results_by_directory, self._write, " ") elif options.missing: self._write("%s: (no baselines found)" % name)
def _optimize_baseline(self, optimizer, test_name): files_to_delete = [] files_to_add = [] for suffix in self._baseline_suffix_list: name = baseline_name(self._tool.filesystem, test_name, suffix) succeeded = optimizer.optimize(name) if not succeeded: _log.error("Heuristics failed to optimize %s", name) return files_to_delete, files_to_add