def test_setup_environ_for_server_register_cygwin(self): port = self.make_port(options=MockOptions(register_cygwin=True, results_directory='/')) port._executive = MockExecutive(should_log=True) expected_logs = "MOCK run_command: ['/mock-checkout/Source/WebKit/chromium/third_party/cygwin/setup_mount.bat'], cwd=None\n" output = outputcapture.OutputCapture() output.assert_outputs(self, port.setup_environ_for_server, expected_logs=expected_logs)
def __init__(self, *args, **kwargs): if 'executive' not in kwargs: kwargs['executive'] = MockExecutive() Credentials.__init__(self, *args, **kwargs)
def __init__(self, filesystem=None, executive=None): self.checkout_root = "/mock-checkout" self.added_paths = set() self._filesystem = filesystem or MockFileSystem() self._executive = executive or MockExecutive()
def fake_executive(output=None): if output: return MockExecutive(output=output) return MockExecutive(exception=SystemError)
def test_show_results_html_file(self): port = self.make_port() # Delay setting a should_log executive to avoid logging from MacPort.__init__. port._executive = MockExecutive(should_log=True) expected_logs = "MOCK popen: ['Tools/Scripts/run-safari', '--release', '--no-saved-state', '-NSOpen', 'test.html'], cwd=/mock-checkout\n" OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
def setUp(self): super(TestRebaselineJson, self).setUp() self.tool.executive = MockExecutive()
def mock_host_for_stub_repository(): host = MockHost(create_stub_repository_files=True) host.filesystem = MockFileSystem(files=FAKE_FILES) host.executive = MockExecutive() return host
def make_scm(self): scm = Git(cwd=".", executive=MockExecutive(), filesystem=MockFileSystem()) scm.read_git_config = lambda *args, **kw: "MOCKKEY:MOCKVALUE" return scm
def test_path_from_webkit_base(self): c = config.Config(MockExecutive(), MockFileSystem()) self.assertTrue(c.path_from_webkit_base('foo'))
def test_execute_git_cl_hangs(self): def blame(_): return """ 6469e754a1 path/to/TestExpectations (<*****@*****.**> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] """ self.tool.git().blame = blame test_port = self.tool.port_factory.get('test') # Have prototype-chocolate only fail on "MOCK Mac10.11". self.tool.buildbot.set_results( Build('MOCK Mac10.11'), LayoutTestResults({ 'tests': { 'fast': { 'dom': { 'prototype-taco.html': { 'expected': 'PASS', 'actual': 'PASS TEXT', 'is_unexpected': True } } } } })) self.tool.filesystem.write_text_file( test_port.path_to_generic_test_expectations_file(), """ Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] """) self._write_test_file(test_port, 'fast/dom/prototype-taco.html', 'Dummy test contents') self.tool.builders = BuilderList({ 'MOCK Mac10.11': { 'port_name': 'test-mac-mac10.11', 'specifiers': ['Mac10.11', 'Release'] }, }) self.command.SECONDS_BEFORE_GIVING_UP = 0 self.command.tree_status = lambda: 'open' self.tool.executive = MockExecutive() self.tool.executive.full_calls = [] self._execute_with_mock_options() self.assertEqual(self.tool.executive.calls, [ [[ 'python', 'echo', 'copy-existing-baselines-internal', '--test', 'fast/dom/prototype-taco.html', '--suffixes', 'txt', '--port-name', 'test-mac-mac10.11', ]], [[ 'python', 'echo', 'rebaseline-test-internal', '--test', 'fast/dom/prototype-taco.html', '--suffixes', 'txt', '--port-name', 'test-mac-mac10.11', '--builder', 'MOCK Mac10.11', ]], [[ 'python', 'echo', 'optimize-baselines', '--suffixes', 'txt', 'fast/dom/prototype-taco.html', ]], ['git', 'cl', 'upload', '-f'], ])
def mock_command_exec(vals): def run_fn(args): sub_command = args[1] return vals.get(sub_command, '') return MockExecutive(run_command_fn=run_fn)
def test_check_sys_deps(self): port = self.make_port() port._executive = MockExecutive(exit_code=0) # pylint: disable=protected-access self.assertEqual(port.check_sys_deps(needs_http=False), test_run_results.OK_EXIT_STATUS) port._executive = MockExecutive(exit_code=1, output='testing output failure') # pylint: disable=protected-access self.assertEqual(port.check_sys_deps(needs_http=False), test_run_results.SYS_DEPS_EXIT_STATUS)
def test_diff_image_crashed(self): port = self.make_port() port._executive = MockExecutive(exit_code=2) # pylint: disable=protected-access self.assertEqual(port.diff_image("EXPECTED", "ACTUAL"), (None, 'Image diff returned an exit code of 2. See http://crbug.com/278596'))
def test_rebaseline_expectations(self): command = RebaselineExpectations() tool = MockTool() command.bind_to_tool(tool) for port_name in tool.port_factory.all_port_names(): port = tool.port_factory.get(port_name) for path in port.expectations_files(): tool.filesystem.write_text_file(path, '') # Don't enable logging until after we create the mock expectation files as some Port.__init__'s run subcommands. tool.executive = MockExecutive(should_log=True) def run_in_parallel(commands): print commands return "" tool.executive.run_in_parallel = run_in_parallel expected_logs = """Retrieving results for chromium-linux-x86 from Webkit Linux 32. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for chromium-linux-x86_64 from Webkit Linux. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for chromium-mac-lion from Webkit Mac10.7. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for chromium-mac-snowleopard from Webkit Mac10.6. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for chromium-win-win7 from Webkit Win7. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for chromium-win-xp from Webkit Win. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for efl from EFL Linux 64-bit Release. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for gtk from GTK Linux 64-bit Release. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for mac-lion from Apple Lion Release WK1 (Tests). userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for qt-linux from Qt Linux Release. userscripts/another-test.html (txt) userscripts/images.svg (png) Retrieving results for win-7sp0 from Apple Win 7 Release (Tests). userscripts/another-test.html (txt) userscripts/images.svg (png) Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. """ expected_stdout = """[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Win', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Win', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')] """ expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None """ command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])} OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=False), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr) expected_stderr_with_optimize = """MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'png', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None """ command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])} OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr_with_optimize)
def test_rebaseline_expectations(self): command = RebaselineExpectations() tool = MockTool() command.bind_to_tool(tool) for port_name in tool.port_factory.all_port_names(): port = tool.port_factory.get(port_name) tool.filesystem.write_text_file( port.path_to_test_expectations_file(), '') # Don't enable logging until after we create the mock expectation files as some Port.__init__'s run subcommands. tool.executive = MockExecutive(should_log=True) expected_stdout = """Retrieving results for chromium-gpu-mac-snowleopard from Webkit Mac10.6 - GPU. Retrieving results for chromium-gpu-win-win7 from Webkit Win7 - GPU. Retrieving results for chromium-gpu-win-xp from Webkit Win - GPU. Retrieving results for chromium-linux-x86 from Webkit Linux 32. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-linux-x86_64 from Webkit Linux. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-mac-leopard from Webkit Mac10.5. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-mac-snowleopard from Webkit Mac10.6. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-win-vista from Webkit Vista. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-win-win7 from Webkit Win7. userscripts/another-test.html userscripts/images.svg Retrieving results for chromium-win-xp from Webkit Win. userscripts/another-test.html userscripts/images.svg Optimizing baselines for userscripts/another-test.html. Optimizing baselines for userscripts/images.svg. """ expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Linux 32', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Linux 32', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Linux', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Linux', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Mac10.5', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Mac10.5', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Mac10.6', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Mac10.6', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Vista', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Vista', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Win7', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Win7', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Win', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'rebaseline-test', 'Webkit Win', 'userscripts/images.svg'], cwd=/mock-checkout MOCK run_command: ['echo', 'optimize-baselines', 'userscripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'optimize-baselines', 'userscripts/images.svg'], cwd=/mock-checkout """ command._tests_to_rebaseline = lambda port: [] if not port.name().find( '-gpu-') == -1 else [ 'userscripts/another-test.html', 'userscripts/images.svg' ] OutputCapture().assert_outputs(self, command.execute, [None, [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
def _make_checkout(self): return Checkout(scm=MockSCM(), filesystem=MockFileSystem(), executive=MockExecutive())
def test_get_issue_number(self): host = MockHost() host.executive = MockExecutive(output='Issue number: 12345 (http://crrev.com/12345)') git_cl = GitCL(host) self.assertEqual(git_cl.get_issue_number(), '12345')
def test_cl_description_moves_noexport_tag(self): host = MockHost() host.executive = MockExecutive(output='Summary\n\nNo-Export: true\n\n') importer = TestImporter(host) description = importer._cl_description(directory_owners={}) self.assertIn('No-Export: true', description)
def test_get_issue_number_none(self): host = MockHost() host.executive = MockExecutive(output='Issue number: None (None)') git_cl = GitCL(host) self.assertEqual(git_cl.get_issue_number(), 'None')
def test_rebaseline_expectations(self): self._zero_out_test_expectations() self.tool.executive = MockExecutive() for builder in ['MOCK Mac10.10', 'MOCK Mac10.11']: self.tool.buildbot.set_results( Build(builder), LayoutTestResults({ 'tests': { 'userscripts': { 'another-test.html': { 'expected': 'PASS', 'actual': 'PASS TEXT' }, 'images.svg': { 'expected': 'FAIL', 'actual': 'IMAGE+TEXT' } } } })) self._write('userscripts/another-test.html', 'Dummy test contents') self._write('userscripts/images.svg', 'Dummy test contents') self.command._tests_to_rebaseline = lambda port: { 'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png']), 'userscripts/not-actually-failing.html': set(['txt', 'png', 'wav'] ), } self.command.execute(self.options(), [], self.tool) self.assertEqual(self.tool.executive.calls, [ [ [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/another-test.html' ], [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/another-test.html' ], [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'png', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/images.svg' ], [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'png', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/images.svg' ], ], [ [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/another-test.html' ], [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/another-test.html' ], [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/images.svg' ], [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/images.svg' ], ], ])
def test_some_commands_not_run_with_auth(self): host = MockHost() host.executive = MockExecutive(output='mock-output') git_cl = GitCL(host, auth_refresh_token_json='token.json') git_cl.run(['issue']) self.assertEqual(host.executive.calls, [['git', 'cl', 'issue']])
def test_rebaseline_expectations_reftests(self): self._zero_out_test_expectations() self.tool.executive = MockExecutive() for builder in ['MOCK Mac10.10', 'MOCK Mac10.11']: self.tool.buildbot.set_results( Build(builder), LayoutTestResults({ "tests": { "userscripts": { "reftest-text.html": { "expected": "PASS", "actual": "TEXT" }, "reftest-image.html": { "expected": "FAIL", "actual": "IMAGE" }, "reftest-image-text.html": { "expected": "FAIL", "actual": "IMAGE+TEXT" } } } })) self._write("userscripts/reftest-text.html", "Dummy test contents") self._write("userscripts/reftest-text-expected.html", "Dummy test contents") self._write("userscripts/reftest-text-expected.html", "Dummy test contents") self.command._tests_to_rebaseline = lambda port: { 'userscripts/reftest-text.html': set(['txt']), 'userscripts/reftest-image.html': set(['png']), 'userscripts/reftest-image-text.html': set(['png', 'txt']), } self.command.execute(self.options(), [], self.tool) self.assertEqual(self.tool.executive.calls, [ [ [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/reftest-text.html' ], [ 'python', 'echo', 'copy-existing-baselines-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/reftest-text.html' ], ], [ [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.10', '--test', 'userscripts/reftest-text.html' ], [ 'python', 'echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK Mac10.11', '--test', 'userscripts/reftest-text.html' ], ], ])
def __init__(self, testFunc): self.tool = MockTool() self.tool.executive = MockExecutive(should_log=True) self.tool.filesystem.files[ TestPortFactory.path_to_test_expectations_file()] = "" unittest.TestCase.__init__(self, testFunc)
def __init__(self): self._filesystem = MockFileSystem() self._executive = MockExecutive()
def __init__(self): self.tool = MockTool() self.tool.executive = MockExecutive(should_log=True) self.tool.filesystem.files[ TestPortFactory.path_to_generic_test_expectations_file()] = ""
def test_show_results_html_file(self): port = self.make_port() port._executive = MockExecutive(should_log=True) expected_stderr = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--qt', 'file://test.html'], cwd=/mock-checkout\n" OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_stderr=expected_stderr)
def test_rebaseline_all(self): old_exact_matches = builders._exact_matches builders._exact_matches = { "MOCK builder": { "port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"]) }, "MOCK builder (Debug)": { "port_name": "test-mac-leopard", "specifiers": set(["mock-specifier", "debug"]) }, } command = RebaselineJson() tool = MockTool() options = MockOptions() options.optimize = True command.bind_to_tool(tool) tool.executive = MockExecutive(should_log=True) expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout """ OutputCapture().assert_outputs( self, command._rebaseline, [ options, { "user-scripts/another-test.html": { "MOCK builder": ["txt", "png"] } } ], expected_stderr=expected_stderr) expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder (Debug)', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout """ OutputCapture().assert_outputs( self, command._rebaseline, [ options, { "user-scripts/another-test.html": { "MOCK builder (Debug)": ["txt", "png"] } } ], expected_stderr=expected_stderr) expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scripts/another-test.html'], cwd=/mock-checkout """ OutputCapture().assert_outputs( self, command._rebaseline, [ options, { "user-scripts/another-test.html": { "MOCK builder (Debug)": ["txt", "png"], "MOCK builder": ["txt"] } } ], expected_stderr=expected_stderr) builders._exact_matches = old_exact_matches