summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-19 16:50:47 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-19 16:50:47 -0400
commit8eec054f2e2c7b3f3669f28d382ddcfec39d48f0 (patch)
treeb1b53f3c6a5d28c6eb52c39849445acdf71cebfc /tests/test_data.py
parentb2d9f2638cd7e53687401ea89ebaa446e6762512 (diff)
downloadpython-coveragepy-git-8eec054f2e2c7b3f3669f28d382ddcfec39d48f0.tar.gz
CoverageData.lines() and CoverageData.arcs() now distinguish between unmeasured, and measured, but nothing ran
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 11208d67..e48724da 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -134,6 +134,22 @@ class CoverageDataTest(DataTestHelpers, CoverageTest):
covdata.touch_file('zzz.py')
self.assert_measured_files(covdata, MEASURED_FILES_3 + ['zzz.py'])
+ def test_no_lines_vs_unmeasured_file(self):
+ covdata = CoverageData()
+ covdata.add_lines(LINES_1)
+ covdata.touch_file('zzz.py')
+ self.assertEqual(covdata.lines('zzz.py'), [])
+ self.assertIsNone(covdata.lines('no_such_file.py'))
+
+ def test_no_arcs_vs_unmeasured_file(self):
+ covdata = CoverageData()
+ covdata.add_arcs(ARCS_3)
+ covdata.touch_file('zzz.py')
+ self.assertEqual(covdata.lines('zzz.py'), [])
+ self.assertIsNone(covdata.lines('no_such_file.py'))
+ self.assertEqual(covdata.arcs('zzz.py'), [])
+ self.assertIsNone(covdata.arcs('no_such_file.py'))
+
def test_plugin_name(self):
covdata = CoverageData()
covdata.add_plugins({"p1.foo": "p1.plugin", "p2.html": "p2.plugin"})