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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py

Issue 2192403002: Remove MockOptions, and replace all usages of it with optparse.Values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index e74c2c1d8add7911ba549c560f0016d837cf3a45..1d6efd5513b0df7d93f645bab8060582ef1478f6 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -27,11 +27,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import optparse
import unittest
from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.tool.commands.queries import *
-from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions
+from webkitpy.tool.commands.queries import PrintBaselines
+from webkitpy.tool.commands.queries import PrintExpectations
+from webkitpy.tool.mock_tool import MockWebKitPatch
class PrintExpectationsTest(unittest.TestCase):
@@ -42,7 +44,7 @@ class PrintExpectationsTest(unittest.TestCase):
'include_keyword': [], 'exclude_keyword': [], 'paths': False,
}
options_defaults.update(kwargs)
- options = MockOptions(**options_defaults)
+ options = optparse.Values(dict(**options_defaults))
tool = MockWebKitPatch()
tool.port_factory.all_port_names = lambda: [
'test-linux-trusty', 'test-linux-precise',
@@ -141,8 +143,8 @@ class PrintBaselinesTest(unittest.TestCase):
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, include_virtual_tests=False,
- csv=False, platform=None), ['passes/text.html'], self.tool)
+ options = optparse.Values({'all': False, 'include_virtual_tests': False, 'csv': False, 'platform': None})
+ command.execute(options, ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('// For test-win-win7\n'
@@ -153,8 +155,8 @@ class PrintBaselinesTest(unittest.TestCase):
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, include_virtual_tests=False, csv=False,
- platform='test-win-*'), ['passes/text.html'], self.tool)
+ options = optparse.Values({'all': False, 'include_virtual_tests': False, 'csv': False, 'platform': 'test-win-*'})
+ command.execute(options, ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('// For test-win-win10\n'
@@ -169,8 +171,8 @@ class PrintBaselinesTest(unittest.TestCase):
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, platform='*win7', csv=True,
- include_virtual_tests=False), ['passes/text.html'], self.tool)
+ options = optparse.Values({'all': False, 'platform': '*win7', 'csv': True, 'include_virtual_tests': False})
+ command.execute(options, ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('test-win-win7,passes/text.html,None,png,passes/text-expected.png,None\n'

Powered by Google App Engine
This is Rietveld 408576698