コード例 #1
0
 def setUp(self):  # pylint: disable=invalid-name
     """ Set up the fixture for the unit tests. """
     self.__report = FakeUnitTestReport()
     project = domain.Project(
         metric_sources={metric_source.UnitTestReport: self.__report})
     self.__metric = metric.FailingUnittests(subject=FakeSubject(),
                                             project=project)
コード例 #2
0
 def test_status_with_zero_unittests(self):
     """ Test that the metric is red when there are no unit tests. """
     report = FakeUnitTestReport(unittests=0)
     project = domain.Project(
         metric_sources={metric_source.UnitTestReport: report})
     failing_unittests = metric.FailingUnittests(subject=FakeSubject(),
                                                 project=project)
     self.assertEqual('red', failing_unittests.status())
コード例 #3
0
 def test_report_with_zero_unittests(self):
     """ Test that the report is different when there are no unit tests. """
     report = FakeUnitTestReport(unittests=0)
     project = domain.Project(
         metric_sources={metric_source.UnitTestReport: report})
     failing_unittests = metric.FailingUnittests(subject=FakeSubject(),
                                                 project=project)
     self.assertEqual('Er zijn geen unittesten.',
                      failing_unittests.report())
コード例 #4
0
 def test_status_without_metric_source(self):
     """ Test that the metric is red when there is no metric source. """
     failing_unittests = metric.FailingUnittests(subject=FakeSubject(),
                                                 project=domain.Project())
     self.assertEqual('red', failing_unittests.status())