Пример #1
0
    def run_test(self, tests, expected_stdout, platform='test-win-win7', **kwargs):
        options_defaults = {
            'all': False, 'csv': False, 'full': False, 'platform': platform,
            'include_keyword': [], 'exclude_keyword': [], 'paths': False,
        }
        options_defaults.update(kwargs)
        options = optparse.Values(dict(**options_defaults))
        tool = MockBlinkTool()
        tool.port_factory.all_port_names = lambda: [
            'test-linux-trusty', 'test-linux-precise',
            'test-mac-mac10.11', 'test-mac-mac10.10',
            'test-win-win10', 'test-win-win7'
        ]
        command = PrintExpectations()

        oc = OutputCapture()
        try:
            oc.capture_output()
            command.execute(options, tests, tool)
        finally:
            stdout, _, _ = oc.restore_output()
        self.assertMultiLineEqual(stdout, expected_stdout)
Пример #2
0
 def __init__(self, path):
     super(BlinkTool, self).__init__()
     self._path = path
     self.commands = [
         AnalyzeBaselines(),
         CopyExistingBaselines(),
         CrashLog(),
         FlakyTests(),
         OptimizeBaselines(),
         PrettyDiff(),
         PrintBaselines(),
         PrintExpectations(),
         Rebaseline(),
         RebaselineCL(),
         RebaselineTest(),
     ]
     self.help_command = HelpCommand(tool=self)
     self.commands.append(self.help_command)