Bug 1494069 - [mozlint] Verify the expected_exclude paths in test_filterpaths, r=rwood
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 16 Oct 2018 21:04:15 +0000
changeset 500146 b9beb91e999214dfce51b7829b1f28de6b4e5581
parent 500145 53abbe1d64d4c976e07be000b2525a75b07f6c0a
child 500147 8a1fd7460ad555447b8d9d8e7dd3724d2ac2427f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrwood
bugs1494069
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494069 - [mozlint] Verify the expected_exclude paths in test_filterpaths, r=rwood Depends on D8844 Differential Revision: https://phabricator.services.mozilla.com/D5863
python/mozlint/test/test_pathutils.py
--- a/python/mozlint/test/test_pathutils.py
+++ b/python/mozlint/test/test_pathutils.py
@@ -38,16 +38,17 @@ TEST_CASES = (
         'expected': ['subdir1/subdir3/d.js'],
     },
     {
         'paths': ['.'],
         'include': ['.'],
         'exclude': ['**/c.py', 'subdir1/subdir3'],
         'extensions': ['py'],
         'expected': ['.'],
+        'expected_exclude': ['subdir2/c.py', 'subdir1/subdir3'],
     },
     {
         'paths': ['a.py', 'a.js', 'subdir1/b.py', 'subdir2/c.py', 'subdir1/subdir3/d.py'],
         'include': ['.'],
         'exclude': ['**/c.py', 'subdir1/subdir3'],
         'extensions': ['py'],
         'expected': ['a.py', 'subdir1/b.py'],
     },
@@ -59,19 +60,21 @@ TEST_CASES = (
         'expected': ['a.py', 'subdir2'],
     },
 )
 
 
 @pytest.mark.parametrize('test', TEST_CASES)
 def test_filterpaths(test):
     expected = test.pop('expected')
+    expected_exclude = test.pop('expected_exclude', [])
 
     paths, exclude = pathutils.filterpaths(root, **test)
     assert_paths(paths, expected)
+    assert_paths(exclude, expected_exclude)
 
 
 @pytest.mark.parametrize('paths,expected', [
     (['subdir1/*'], ['subdir1']),
     (['subdir2/*'], ['subdir2']),
     (['subdir1/*.*', 'subdir1/subdir3/*', 'subdir2/*'], ['subdir1', 'subdir2']),
     ([root + '/*', 'subdir1/*.*', 'subdir1/subdir3/*', 'subdir2/*'], [root]),
     (['subdir1/b.py', 'subdir1/subdir3'], ['subdir1/b.py', 'subdir1/subdir3']),