Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py

Issue 2544173002: Skip commits that don't generate a patch + fixes to get export working (Closed)
Patch Set: Refactor TestExporter, clean up other parts Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from webkitpy.common.host_mock import MockHost 7 from webkitpy.common.host_mock import MockHost
8 from webkitpy.common.system.executive_mock import MockExecutive2 8 from webkitpy.common.system.executive_mock import MockExecutive2
9 from webkitpy.w3c.test_exporter import TestExporter 9 from webkitpy.w3c.test_exporter import TestExporter
10 from webkitpy.w3c.wpt_github_mock import MockWPTGitHub 10 from webkitpy.w3c.wpt_github_mock import MockWPTGitHub
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 git_command = args[1] 51 git_command = args[1]
52 if git_command == 'rev-list': 52 if git_command == 'rev-list':
53 return 'facebeef\ncafedad5' 53 return 'facebeef\ncafedad5'
54 elif git_command == 'footers': 54 elif git_command == 'footers':
55 return 'fake-cr-position' 55 return 'fake-cr-position'
56 elif git_command == 'show': 56 elif git_command == 'show':
57 if 'cafedad5' in args: 57 if 'cafedad5' in args:
58 return 'newer fake text' 58 return 'newer fake text'
59 elif 'facebeef' in args: 59 elif 'facebeef' in args:
60 return 'older fake text' 60 return 'older fake text'
61 elif git_command == 'remote':
62 return 'github'
63 elif git_command == 'format-patch':
64 return 'fake patch'
65 elif git_command == 'diff':
66 return 'fake patch diff'
61 else: 67 else:
62 return '' 68 return ''
63 69
64 host.executive = MockExecutive2(run_command_fn=mock_command) 70 host.executive = MockExecutive2(run_command_fn=mock_command)
65 wpt_github = MockWPTGitHub(pull_requests=[]) 71 wpt_github = MockWPTGitHub(pull_requests=[])
66 72
67 TestExporter(host, wpt_github).run() 73 TestExporter(host, wpt_github).run()
68 74
69 self.assertEqual(wpt_github.calls, ['in_flight_pull_requests', 'create_p r']) 75 self.assertEqual(wpt_github.calls, ['in_flight_pull_requests', 'create_p r'])
70 self.assertEqual(wpt_github.pull_requests_created, 76 self.assertEqual(wpt_github.pull_requests_created,
71 [('chromium-export-try', 'older fake text', 'older fake text')]) 77 [('chromium-export-try', 'older fake text', 'older fake text')])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698