diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-09 09:48:51 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-09 09:48:51 -0400 |
| commit | 9b685f291dee3f23785a0ab3dff4e413ea98f0da (patch) | |
| tree | 98bb93741b7e0226394fc3962b1970c49b07c2d5 /tests/test_files.py | |
| parent | 86d6a54b93c92722c46796cae54b63eed9a6afd6 (diff) | |
| download | python-coveragepy-9b685f291dee3f23785a0ab3dff4e413ea98f0da.tar.gz | |
Move flat_rootname from FileReporter to a utility function.
Diffstat (limited to 'tests/test_files.py')
| -rw-r--r-- | tests/test_files.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index b658853..813f861 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -9,7 +9,7 @@ import os.path from coverage import files from coverage.files import ( TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases, - find_python_files, abs_file, actual_path + find_python_files, abs_file, actual_path, flat_rootname, ) from coverage.misc import CoverageException from coverage import env @@ -54,6 +54,10 @@ class FilesTest(CoverageTest): rel = os.path.join('sub', trick, 'file1.py') self.assertEqual(files.relative_filename(abs_file(rel)), rel) + def test_flat_rootname(self): + self.assertEqual(flat_rootname("a/b/c.py"), "a_b_c_py") + self.assertEqual(flat_rootname(r"c:\foo\bar.html"), "c__foo_bar_html") + class MatcherTest(CoverageTest): """Tests of file matchers.""" |
