summaryrefslogtreecommitdiff
path: root/tests/test_files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-06-16 16:17:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-06-16 16:17:24 -0400
commitaac8f658b4ae955b241e4cb54ca61690a19df418 (patch)
treecffdbe935dac8cfb9badc456daf90d2be3fea19b /tests/test_files.py
parent01d491ea56ad2d588898ee2ab70b99731f1b26c1 (diff)
downloadpython-coveragepy-git-aac8f658b4ae955b241e4cb54ca61690a19df418.tar.gz
Be more specific with PathAliases tests.
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index 6549c0ad..e5dafdf6 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -156,14 +156,18 @@ class PathAliasesTest(CoverageTest):
"""
self.assertEqual(aliases.map(inp), files.canonical_filename(out))
+ def assert_not_mapped(self, aliases, inp):
+ """Assert that `inp` mapped through `aliases` is unchanged."""
+ self.assertEqual(aliases.map(inp), inp)
+
def test_noop(self):
aliases = PathAliases()
- self.assert_mapped(aliases, '/ned/home/a.py', '/ned/home/a.py')
+ self.assert_not_mapped(aliases, '/ned/home/a.py')
def test_nomatch(self):
aliases = PathAliases()
aliases.add('/home/*/src', './mysrc')
- self.assert_mapped(aliases, '/home/foo/a.py', '/home/foo/a.py')
+ self.assert_not_mapped(aliases, '/home/foo/a.py')
def test_wildcard(self):
aliases = PathAliases()
@@ -177,7 +181,7 @@ class PathAliasesTest(CoverageTest):
def test_no_accidental_match(self):
aliases = PathAliases()
aliases.add('/home/*/src', './mysrc')
- self.assert_mapped(aliases, '/home/foo/srcetc', '/home/foo/srcetc')
+ self.assert_not_mapped(aliases, '/home/foo/srcetc')
def test_multiple_patterns(self):
aliases = PathAliases()