Exemple #1
0
 def test_contexts_by_lineno_with_lines(self):
     covdata = CoverageData()
     covdata.set_context('test_a')
     covdata.add_lines(LINES_1)
     assert covdata.contexts_by_lineno('a.py') == {
         1: ['test_a'],
         2: ['test_a']
     }
Exemple #2
0
 def test_contexts_by_lineno_with_lines(self):
     covdata = CoverageData()
     covdata.set_context('test_a')
     covdata.add_lines(LINES_1)
     self.assertDictEqual(covdata.contexts_by_lineno('a.py'), {
         1: ['test_a'],
         2: ['test_a']
     })
Exemple #3
0
 def test_contexts_by_lineno_with_lines(self):
     self.skip_unless_data_storage_is("sql")
     covdata = CoverageData()
     covdata.set_context('test_a')
     covdata.add_lines(LINES_1)
     self.assertDictEqual(covdata.contexts_by_lineno('a.py'), {
         1: ['test_a'],
         2: ['test_a']
     })
Exemple #4
0
 def test_contexts_by_lineno_with_arcs(self):
     covdata = CoverageData()
     covdata.set_context('test_x')
     covdata.add_arcs(ARCS_3)
     self.assertDictEqual(covdata.contexts_by_lineno('x.py'), {
         -1: ['test_x'],
         1: ['test_x'],
         2: ['test_x'],
         3: ['test_x']
     })
Exemple #5
0
 def test_contexts_by_lineno_with_arcs(self):
     covdata = CoverageData()
     covdata.set_context('test_x')
     covdata.add_arcs(ARCS_3)
     expected = {
         -1: ['test_x'],
         1: ['test_x'],
         2: ['test_x'],
         3: ['test_x']
     }
     assert expected == covdata.contexts_by_lineno('x.py')
Exemple #6
0
 def test_contexts_by_lineno_with_arcs(self):
     self.skip_unless_data_storage_is("sql")
     covdata = CoverageData()
     covdata.set_context('test_x')
     covdata.add_arcs(ARCS_3)
     self.assertDictEqual(covdata.contexts_by_lineno('x.py'), {
         -1: ['test_x'],
         1: ['test_x'],
         2: ['test_x'],
         3: ['test_x']
     })
Exemple #7
0
 def test_contexts_by_lineno_with_unknown_file(self):
     covdata = CoverageData()
     self.assertDictEqual(covdata.contexts_by_lineno('xyz.py'), {})
Exemple #8
0
 def test_contexts_by_lineno_with_unknown_file(self):
     covdata = CoverageData()
     assert covdata.contexts_by_lineno('xyz.py') == {}
Exemple #9
0
 def test_contexts_by_lineno_with_unknown_file(self):
     self.skip_unless_data_storage_is("sql")
     covdata = CoverageData()
     self.assertDictEqual(covdata.contexts_by_lineno('xyz.py'), {})