Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py |
| index 20fd78e95d0ca610e65321d6f5347196b99bc79d..6b57a2a8bd25f7e28fa76b8eccab7c5711fc3e10 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py |
| @@ -6,6 +6,8 @@ import unittest |
| from webkitpy.common.host_mock import MockHost |
| from webkitpy.common.system.executive_mock import MockExecutive2 |
| from webkitpy.w3c.chromium_commit import ChromiumCommit |
| +from webkitpy.w3c.test_exporter import CHROMIUM_WPT_DIR |
| +from webkitpy.w3c.test_exporter_unittest import mock_command_exec |
| class ChromiumCommitTest(unittest.TestCase): |
| @@ -24,3 +26,24 @@ class ChromiumCommitTest(unittest.TestCase): |
| self.assertEqual(chromium_commit.position, 'refs/heads/master@{#789}') |
| self.assertEqual(chromium_commit.sha, 'deadbeefcafe') |
| + |
| + def test_filtered_changed_files_blacklist(self): |
| + host = MockHost() |
| + |
| + fake_files = ['file1', 'MANIFEST.json', 'file3'] |
| + qualified_fake_files = [CHROMIUM_WPT_DIR + f for f in fake_files] |
| + |
| + host.executive = mock_command_exec({ |
| + 'diff-tree': '\n'.join(qualified_fake_files), |
| + 'crrev-parse': 'fake rev', |
| + }) |
| + |
| + pos = 'Cr-Commit-Position: refs/heads/master@{#789}' |
|
qyearsley
2016/12/21 00:24:46
Nit: if you want to avoid abbreviation variable na
jeffcarp
2016/12/21 19:12:52
Done, abbreviated variables begone! I chose to nam
qyearsley
2016/12/21 19:19:56
Yeah -- the main reason I've heard before is that
|
| + chromium_commit = ChromiumCommit(host, position=pos) |
| + |
| + files = chromium_commit.filtered_changed_files() |
| + |
| + expected_files = ['file1', 'file3'] |
| + qualified_expected_files = [CHROMIUM_WPT_DIR + f for f in expected_files] |
| + |
| + self.assertEqual(files, qualified_expected_files) |