diff options
author | Danny Allen <me@dannya.com> | 2014-08-11 16:13:06 +0100 |
---|---|---|
committer | Danny Allen <me@dannya.com> | 2014-08-11 16:13:06 +0100 |
commit | e38016c499921dd7bf5919a699a76305a1936129 (patch) | |
tree | 07a4125732561f2489dfb6b75a339cfef46d80d4 /tests/test_files.py | |
parent | c81183f614ca982cd2ed93ac8e6e76610d162202 (diff) | |
parent | ee5ea987f8978d91c1ef189fe4f334511ddf6215 (diff) | |
download | python-coveragepy-git-e38016c499921dd7bf5919a699a76305a1936129.tar.gz |
Merged ned/coveragepy into default
Diffstat (limited to 'tests/test_files.py')
-rw-r--r-- | tests/test_files.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index f93feba7..070430ff 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -93,6 +93,12 @@ class MatcherTest(CoverageTest): for filepath, matches in matches_to_try: self.assertMatches(fnm, filepath, matches) + def test_fnmatch_matcher_overload(self): + fnm = FnmatchMatcher(["*x%03d*.txt" % i for i in range(500)]) + self.assertMatches(fnm, "x007foo.txt", True) + self.assertMatches(fnm, "x123foo.txt", True) + self.assertMatches(fnm, "x798bar.txt", False) + class PathAliasesTest(CoverageTest): """Tests for coverage/files.py:PathAliases""" @@ -131,11 +137,11 @@ class PathAliasesTest(CoverageTest): def test_cant_have_wildcard_at_end(self): aliases = PathAliases() msg = "Pattern must not end with wildcards." - with self.assertRaisesRegexp(CoverageException, msg): + with self.assertRaisesRegex(CoverageException, msg): aliases.add("/ned/home/*", "fooey") - with self.assertRaisesRegexp(CoverageException, msg): + with self.assertRaisesRegex(CoverageException, msg): aliases.add("/ned/home/*/", "fooey") - with self.assertRaisesRegexp(CoverageException, msg): + with self.assertRaisesRegex(CoverageException, msg): aliases.add("/ned/home/*/*/", "fooey") def test_no_accidental_munging(self): @@ -177,7 +183,7 @@ class RelativePathAliasesTest(CoverageTest): aliases.add(d, '/the/source') the_file = os.path.join(d, 'a.py') the_file = os.path.expanduser(the_file) - the_file = os.path.abspath(the_file) + the_file = os.path.abspath(os.path.realpath(the_file)) assert '~' not in the_file # to be sure the test is pure. self.assertEqual(aliases.map(the_file), '/the/source/a.py') |