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

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

Issue 1998413002: Simplify import-w3c-tests: support exactly one argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 6 #
7 # 1. Redistributions of source code must retain the above 7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following 8 # copyright notice, this list of conditions and the following
9 # disclaimer. 9 # disclaimer.
10 # 2. Redistributions in binary form must reproduce the above 10 # 2. Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 import optparse 28 import optparse
29 import unittest 29 import unittest
30 30
31 from webkitpy.common.host_mock import MockHost 31 from webkitpy.common.host_mock import MockHost
32 from webkitpy.common.system.filesystem_mock import MockFileSystem 32 from webkitpy.common.system.filesystem_mock import MockFileSystem
33 from webkitpy.common.system.executive_mock import MockExecutive2, ScriptError 33 from webkitpy.common.system.executive_mock import MockExecutive2, ScriptError
34 from webkitpy.common.system.outputcapture import OutputCapture 34 from webkitpy.common.system.outputcapture import OutputCapture
35 from webkitpy.w3c.test_importer import TestImporter 35 from webkitpy.w3c.test_importer import TestImporter
36 36
37 37
38 FAKE_SOURCE_DIR = '/blink/w3c' 38 FAKE_SOURCE_REPO_DIR = '/blink'
39 FAKE_REPO_DIR = '/blink'
40 39
41 FAKE_FILES = {'/mock-checkout/third_party/Webkit/LayoutTests/w3c/OWNERS': '', 40 FAKE_FILES = {'/mock-checkout/third_party/Webkit/LayoutTests/w3c/OWNERS': '',
42 '/blink/w3c/dir/README.txt': '', 41 '/blink/w3c/dir/README.txt': '',
43 '/blink/w3c/dir/OWNERS': '', 42 '/blink/w3c/dir/OWNERS': '',
44 '/blink/w3c/dir1/OWNERS': '', 43 '/blink/w3c/dir1/OWNERS': '',
45 '/mock-checkout/third_party/WebKit/LayoutTests/w3c/README.txt': '' , 44 '/mock-checkout/third_party/WebKit/LayoutTests/w3c/README.txt': '' ,
46 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectatio ns': ''} 45 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectatio ns': ''}
47 46
48 47
49 48
(...skipping 10 matching lines...) Expand all
60 } 59 }
61 options.update(kwargs) 60 options.update(kwargs)
62 return optparse.Values(options) 61 return optparse.Values(options)
63 62
64 def test_import_dir_with_no_tests(self): 63 def test_import_dir_with_no_tests(self):
65 host = MockHost() 64 host = MockHost()
66 host.executive = MockExecutive2(exception=ScriptError( 65 host.executive = MockExecutive2(exception=ScriptError(
67 "abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts /webkitpy/w3c'")) 66 "abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts /webkitpy/w3c'"))
68 host.filesystem = MockFileSystem(files=FAKE_FILES) 67 host.filesystem = MockFileSystem(files=FAKE_FILES)
69 68
70 importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, self.optio ns()) 69 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
71 70
72 oc = OutputCapture() 71 oc = OutputCapture()
73 oc.capture_output() 72 oc.capture_output()
74 try: 73 try:
75 importer.do_import() 74 importer.do_import()
76 finally: 75 finally:
77 oc.restore_output() 76 oc.restore_output()
78 77
79 def test_path_too_long_true(self): 78 def test_path_too_long_true(self):
80 importer = TestImporter(MockHost(), FAKE_SOURCE_DIR, FAKE_REPO_DIR, self .options()) 79 importer = TestImporter(MockHost(), FAKE_SOURCE_REPO_DIR, self.options() )
81 self.assertTrue(importer.path_too_long(FAKE_REPO_DIR + '/' + ('x' * 150) + '.html')) 80 self.assertTrue(importer.path_too_long(FAKE_SOURCE_REPO_DIR + '/' + ('x' * 150) + '.html'))
82 81
83 def test_path_too_long_false(self): 82 def test_path_too_long_false(self):
84 importer = TestImporter(MockHost(), FAKE_SOURCE_DIR, FAKE_REPO_DIR, self .options()) 83 importer = TestImporter(MockHost(), FAKE_SOURCE_REPO_DIR, self.options() )
85 self.assertFalse(importer.path_too_long(FAKE_REPO_DIR + '/x.html')) 84 self.assertFalse(importer.path_too_long(FAKE_SOURCE_REPO_DIR + '/x.html' ))
86 85
87 def test_does_not_import_owner_files(self): 86 def test_does_not_import_owner_files(self):
88 host = MockHost() 87 host = MockHost()
89 host.filesystem = MockFileSystem(files=FAKE_FILES) 88 host.filesystem = MockFileSystem(files=FAKE_FILES)
90 importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, self.optio ns()) 89 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
91 importer.find_importable_tests(FAKE_REPO_DIR) 90 importer.find_importable_tests()
92 self.assertEqual(importer.import_list, 91 self.assertEqual(importer.import_list,
93 [{'copy_list': [{'dest': 'README.txt', 'src': '/blink/w 3c/dir/README.txt'}], 92 [{'copy_list': [{'dest': 'README.txt', 'src': '/blink/w 3c/dir/README.txt'}],
94 'dirname': '/blink/w3c/dir', 93 'dirname': '/blink/w3c/dir',
95 'jstests': 0, 94 'jstests': 0,
96 'reftests': 0, 95 'reftests': 0,
97 'total_tests': 0}]) 96 'total_tests': 0}])
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698