Commit f774a0be authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #818 from timheap/fix-816-file-order

Sort manifest file list in tests
parents 9b92671f d7523602
...@@ -351,8 +351,8 @@ class TestFileListTest(TempDirTestCase): ...@@ -351,8 +351,8 @@ class TestFileListTest(TempDirTestCase):
l('global/one.txt'), l('global/one.txt'),
l('global/two.txt'), l('global/two.txt'),
] ]
file_list.sort()
file_list.sort()
assert file_list.files == wanted assert file_list.files == wanted
def test_exclude_pattern(self): def test_exclude_pattern(self):
...@@ -369,6 +369,7 @@ class TestFileListTest(TempDirTestCase): ...@@ -369,6 +369,7 @@ class TestFileListTest(TempDirTestCase):
file_list = FileList() file_list = FileList()
file_list.files = ['a.py', 'a.txt'] file_list.files = ['a.py', 'a.txt']
file_list.exclude_pattern('*.py') file_list.exclude_pattern('*.py')
file_list.sort()
assert file_list.files == ['a.txt'] assert file_list.files == ['a.txt']
def test_include_pattern(self): def test_include_pattern(self):
...@@ -386,6 +387,7 @@ class TestFileListTest(TempDirTestCase): ...@@ -386,6 +387,7 @@ class TestFileListTest(TempDirTestCase):
file_list = FileList() file_list = FileList()
self.make_files(['a.py', 'b.txt']) self.make_files(['a.py', 'b.txt'])
file_list.include_pattern('*') file_list.include_pattern('*')
file_list.sort()
assert file_list.files == ['a.py', 'b.txt'] assert file_list.files == ['a.py', 'b.txt']
def test_process_template_line_invalid(self): def test_process_template_line_invalid(self):
...@@ -410,10 +412,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -410,10 +412,12 @@ class TestFileListTest(TempDirTestCase):
self.make_files(['a.py', 'b.txt', l('d/c.py')]) self.make_files(['a.py', 'b.txt', l('d/c.py')])
file_list.process_template_line('include *.py') file_list.process_template_line('include *.py')
file_list.sort()
assert file_list.files == ['a.py'] assert file_list.files == ['a.py']
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('include *.rb') file_list.process_template_line('include *.rb')
file_list.sort()
assert file_list.files == ['a.py'] assert file_list.files == ['a.py']
self.assertWarnings() self.assertWarnings()
...@@ -424,10 +428,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -424,10 +428,12 @@ class TestFileListTest(TempDirTestCase):
file_list.files = ['a.py', 'b.txt', l('d/c.py')] file_list.files = ['a.py', 'b.txt', l('d/c.py')]
file_list.process_template_line('exclude *.py') file_list.process_template_line('exclude *.py')
file_list.sort()
assert file_list.files == ['b.txt', l('d/c.py')] assert file_list.files == ['b.txt', l('d/c.py')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('exclude *.rb') file_list.process_template_line('exclude *.rb')
file_list.sort()
assert file_list.files == ['b.txt', l('d/c.py')] assert file_list.files == ['b.txt', l('d/c.py')]
self.assertWarnings() self.assertWarnings()
...@@ -438,10 +444,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -438,10 +444,12 @@ class TestFileListTest(TempDirTestCase):
self.make_files(['a.py', 'b.txt', l('d/c.py')]) self.make_files(['a.py', 'b.txt', l('d/c.py')])
file_list.process_template_line('global-include *.py') file_list.process_template_line('global-include *.py')
file_list.sort()
assert file_list.files == ['a.py', l('d/c.py')] assert file_list.files == ['a.py', l('d/c.py')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('global-include *.rb') file_list.process_template_line('global-include *.rb')
file_list.sort()
assert file_list.files == ['a.py', l('d/c.py')] assert file_list.files == ['a.py', l('d/c.py')]
self.assertWarnings() self.assertWarnings()
...@@ -452,10 +460,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -452,10 +460,12 @@ class TestFileListTest(TempDirTestCase):
file_list.files = ['a.py', 'b.txt', l('d/c.py')] file_list.files = ['a.py', 'b.txt', l('d/c.py')]
file_list.process_template_line('global-exclude *.py') file_list.process_template_line('global-exclude *.py')
file_list.sort()
assert file_list.files == ['b.txt'] assert file_list.files == ['b.txt']
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('global-exclude *.rb') file_list.process_template_line('global-exclude *.rb')
file_list.sort()
assert file_list.files == ['b.txt'] assert file_list.files == ['b.txt']
self.assertWarnings() self.assertWarnings()
...@@ -466,10 +476,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -466,10 +476,12 @@ class TestFileListTest(TempDirTestCase):
self.make_files(['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')]) self.make_files(['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')])
file_list.process_template_line('recursive-include d *.py') file_list.process_template_line('recursive-include d *.py')
file_list.sort()
assert file_list.files == [l('d/b.py'), l('d/d/e.py')] assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('recursive-include e *.py') file_list.process_template_line('recursive-include e *.py')
file_list.sort()
assert file_list.files == [l('d/b.py'), l('d/d/e.py')] assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
self.assertWarnings() self.assertWarnings()
...@@ -480,10 +492,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -480,10 +492,12 @@ class TestFileListTest(TempDirTestCase):
file_list.files = ['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')] file_list.files = ['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')]
file_list.process_template_line('recursive-exclude d *.py') file_list.process_template_line('recursive-exclude d *.py')
file_list.sort()
assert file_list.files == ['a.py', l('d/c.txt')] assert file_list.files == ['a.py', l('d/c.txt')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('recursive-exclude e *.py') file_list.process_template_line('recursive-exclude e *.py')
file_list.sort()
assert file_list.files == ['a.py', l('d/c.txt')] assert file_list.files == ['a.py', l('d/c.txt')]
self.assertWarnings() self.assertWarnings()
...@@ -494,10 +508,12 @@ class TestFileListTest(TempDirTestCase): ...@@ -494,10 +508,12 @@ class TestFileListTest(TempDirTestCase):
self.make_files(['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')]) self.make_files(['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')])
file_list.process_template_line('graft d') file_list.process_template_line('graft d')
file_list.sort()
assert file_list.files == [l('d/b.py'), l('d/d/e.py')] assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('graft e') file_list.process_template_line('graft e')
file_list.sort()
assert file_list.files == [l('d/b.py'), l('d/d/e.py')] assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
self.assertWarnings() self.assertWarnings()
...@@ -508,9 +524,11 @@ class TestFileListTest(TempDirTestCase): ...@@ -508,9 +524,11 @@ class TestFileListTest(TempDirTestCase):
file_list.files = ['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')] file_list.files = ['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')]
file_list.process_template_line('prune d') file_list.process_template_line('prune d')
file_list.sort()
assert file_list.files == ['a.py', l('f/f.py')] assert file_list.files == ['a.py', l('f/f.py')]
self.assertNoWarnings() self.assertNoWarnings()
file_list.process_template_line('prune e') file_list.process_template_line('prune e')
file_list.sort()
assert file_list.files == ['a.py', l('f/f.py')] assert file_list.files == ['a.py', l('f/f.py')]
self.assertWarnings() self.assertWarnings()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment