From d7f2c64b7071d20378d6864cc4ec1c1c83b09175 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 9 Aug 2015 09:48:51 -0400 Subject: Move flat_rootname from FileReporter to a utility function. --- tests/test_files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/test_files.py') 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.""" -- cgit v1.2.1