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 | d7f2c64b7071d20378d6864cc4ec1c1c83b09175 (patch) | |
tree | 4b8733ebe02d867252b097ea443ebdce7eb26215 /tests/test_files.py | |
parent | 3cc5b11a413426b07a51e86eab20a7e9ebab4f2d (diff) | |
download | python-coveragepy-git-d7f2c64b7071d20378d6864cc4ec1c1c83b09175.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 b658853a..813f8612 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.""" |