summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 05bf0c92..2b01584e 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
-# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests that our test infrastructure is really working!"""
@@ -51,6 +51,23 @@ class CoverageTestTest(CoverageTest):
with self.assertRaises(AssertionError):
self.assert_exists("shadow.txt")
+ def test_file_count(self):
+ self.make_file("abcde.txt", "abcde")
+ self.make_file("axczz.txt", "axczz")
+ self.make_file("afile.txt", "afile")
+ self.assert_file_count("a*.txt", 3)
+ self.assert_file_count("*c*.txt", 2)
+ self.assert_file_count("afile.*", 1)
+ self.assert_file_count("*.q", 0)
+ with self.assertRaises(AssertionError):
+ self.assert_file_count("a*.txt", 13)
+ with self.assertRaises(AssertionError):
+ self.assert_file_count("*c*.txt", 12)
+ with self.assertRaises(AssertionError):
+ self.assert_file_count("afile.*", 11)
+ with self.assertRaises(AssertionError):
+ self.assert_file_count("*.q", 10)
+
def test_assert_startwith(self):
self.assert_starts_with("xyzzy", "xy")
self.assert_starts_with("xyz\nabc", "xy")