diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_data.py | 16 |
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"}) |