def setUp(self):
   self.good_source_to_emma = {
     '/path/to/1/File1.java': '/emma/1.html',
     '/path/2/File2.java': '/emma/2.html',
     '/path/2/File3.java': '/emma/3.html'
   }
   self.line_coverage = [
       emma_coverage_stats.LineCoverage(
           1, '', emma_coverage_stats.COVERED, 1.0),
       emma_coverage_stats.LineCoverage(
           2, '', emma_coverage_stats.COVERED, 1.0),
       emma_coverage_stats.LineCoverage(
           3, '', emma_coverage_stats.NOT_EXECUTABLE, 1.0),
       emma_coverage_stats.LineCoverage(
           4, '', emma_coverage_stats.NOT_COVERED, 1.0),
       emma_coverage_stats.LineCoverage(
           5, '', emma_coverage_stats.PARTIALLY_COVERED, 0.85),
       emma_coverage_stats.LineCoverage(
           6, '', emma_coverage_stats.PARTIALLY_COVERED, 0.20)
   ]
   self.lines_for_coverage = [1, 3, 5, 6]
   with mock.patch('emma_coverage_stats._EmmaHtmlParser._FindElements',
                   return_value=[]):
     self.simple_coverage = emma_coverage_stats._EmmaCoverageStats(
         'fake_dir', {})
Пример #2
0
 def setUp(self):
     self.good_source_to_emma = {
         '/path/to/1/File1.java': '/emma/1.html',
         '/path/2/File2.java': '/emma/2.html',
         '/path/2/File3.java': '/emma/3.html'
     }
     self.line_coverage = [
         emma_coverage_stats.LineCoverage(1, '',
                                          emma_coverage_stats.COVERED, 1.0),
         emma_coverage_stats.LineCoverage(2, '',
                                          emma_coverage_stats.COVERED, 1.0),
         emma_coverage_stats.LineCoverage(
             3, '', emma_coverage_stats.NOT_EXECUTABLE, 1.0),
         emma_coverage_stats.LineCoverage(4, '',
                                          emma_coverage_stats.NOT_COVERED,
                                          1.0),
         emma_coverage_stats.LineCoverage(
             5, '', emma_coverage_stats.PARTIALLY_COVERED, 0.85),
         emma_coverage_stats.LineCoverage(
             6, '', emma_coverage_stats.PARTIALLY_COVERED, 0.20)
     ]
     self.lines_for_coverage = [1, 3, 5, 6]
     with mock.patch('emma_coverage_stats._EmmaHtmlParser._FindElements',
                     return_value=[]):
         self.simple_coverage = emma_coverage_stats._EmmaCoverageStats(
             'fake_dir', {})