|
6 | 6 | from distutils.log import WARN |
7 | 7 | from distutils.errors import DistutilsTemplateError |
8 | 8 | from distutils.filelist import glob_to_re, translate_pattern, FileList |
9 | | -from distutils import filelist |
10 | 9 |
|
11 | | -import test.support |
12 | | -from test.support import captured_stdout, run_unittest |
| 10 | +from test.support import captured_stdout |
13 | 11 | from distutils.tests import support |
14 | 12 |
|
15 | 13 | MANIFEST_IN = """\ |
@@ -294,47 +292,5 @@ def test_process_template(self): |
294 | 292 | self.assertWarnings() |
295 | 293 |
|
296 | 294 |
|
297 | | -class FindAllTestCase(unittest.TestCase): |
298 | | - @test.support.skip_unless_symlink |
299 | | - def test_missing_symlink(self): |
300 | | - with test.support.temp_cwd(): |
301 | | - os.symlink('foo', 'bar') |
302 | | - self.assertEqual(filelist.findall(), []) |
303 | | - |
304 | | - def test_basic_discovery(self): |
305 | | - """ |
306 | | - When findall is called with no parameters or with |
307 | | - '.' as the parameter, the dot should be omitted from |
308 | | - the results. |
309 | | - """ |
310 | | - with test.support.temp_cwd(): |
311 | | - os.mkdir('foo') |
312 | | - file1 = os.path.join('foo', 'file1.txt') |
313 | | - test.support.create_empty_file(file1) |
314 | | - os.mkdir('bar') |
315 | | - file2 = os.path.join('bar', 'file2.txt') |
316 | | - test.support.create_empty_file(file2) |
317 | | - expected = [file2, file1] |
318 | | - self.assertEqual(sorted(filelist.findall()), expected) |
319 | | - |
320 | | - def test_non_local_discovery(self): |
321 | | - """ |
322 | | - When findall is called with another path, the full |
323 | | - path name should be returned. |
324 | | - """ |
325 | | - with test.support.temp_dir() as temp_dir: |
326 | | - file1 = os.path.join(temp_dir, 'file1.txt') |
327 | | - test.support.create_empty_file(file1) |
328 | | - expected = [file1] |
329 | | - self.assertEqual(filelist.findall(temp_dir), expected) |
330 | | - |
331 | | - |
332 | | -def test_suite(): |
333 | | - return unittest.TestSuite([ |
334 | | - unittest.makeSuite(FileListTestCase), |
335 | | - unittest.makeSuite(FindAllTestCase), |
336 | | - ]) |
337 | | - |
338 | | - |
339 | 295 | if __name__ == "__main__": |
340 | | - run_unittest(test_suite()) |
| 296 | + unittest.main() |
0 commit comments