summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-07 07:27:23 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-07 07:27:23 -0400
commit839a1a0209f2ed27215c8f2fb75c710806346b38 (patch)
tree4ecae9ebf2114623701cae7b188eb436af1045fb /tests/test_testing.py
parentb147ea9dafe38e08083842f89502fefd9ba790d7 (diff)
parent305c5fdc378879adaac518ddeac7c22a0c92f49d (diff)
downloadpython-coveragepy-git-839a1a0209f2ed27215c8f2fb75c710806346b38.tar.gz
Merge branch 'master' into nedbat/data-sqlite
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index d8cd0ef0..2b01584e 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -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")