def test_diff_image_failed(self): port = self.make_port() port._server_process_constructor = lambda port, nm, cmd, env: MockServerProcess( lines=['diff: 100% failed\n']) image_differ = ImageDiffer(port) self.assertEqual(image_differ.diff_image('foo', 'bar', 0.1), ('', 100.0, None))
def test_diff_image_passed(self): port = self.make_port() port._server_process_constructor = lambda port, nm, cmd, env, crash_message=None: MockServerProcess( lines=['diff: 0% passed\n']) image_differ = ImageDiffer(port) self.assertEqual(image_differ.diff_image(b'foo', b'bar', 0.1), (None, 0, None))
def test_diff_image_passed(self): port = FakePort(['diff: 0% passed\n']) image_differ = ImageDiffer(port) self.assertEqual(image_differ.diff_image('foo', 'bar', 0.1), (None, 0, None))
def test_diff_image_failed(self): port = FakePort(['diff: 100% failed\n']) image_differ = ImageDiffer(port) self.assertEqual(image_differ.diff_image('foo', 'bar', 0.1), ('', 100.0, None))