def test_write_report_with_single_reporter_and_fail_after_timeout(self): report = Report([MockOReporterThatFailsWrite()], ReportEntryManager()) report.open() d = report.write(MockMeasurement(MockNetTest())) def f(err): self.assertEquals(len(report.reporters),0) d.addBoth(f) return d
def test_write_report_with_multiple_reporter_and_fail_all_reporter(self): report = Report([MockOReporterThatFailsWrite() for x in xrange(3)], ReportEntryManager()) report.open() d = report.write(MockMeasurement(MockNetTest())) def f(err): self.assertEquals(len(report.reporters),0) d.addErrback(f) return d
def test_write_report_with_multiple_reporter_and_fail_a_single_reporter(self): report = Report([MockOReporter(), MockOReporter(), MockOReporterThatFailsWrite()], ReportEntryManager()) d = report.open() self.assertEquals(len(report.reporters),3) d = report.write(MockMeasurement(MockNetTest())) def f(x): # one of the reporters should have been removed self.assertEquals(len(report.reporters), 2) d.addBoth(f) return d
def test_write_report_with_multiple_reporter_and_succeed(self): report = Report([MockOReporter() for x in xrange(3)], ReportEntryManager()) report.open() d = report.write(MockMeasurement(MockNetTest())) return d
def test_write_report_with_single_reporter_and_succeed_after_timeout(self): report = Report([MockOReporterThatFailsWriteOnce()], ReportEntryManager()) report.open() d = report.write(MockMeasurement(MockNetTest())) return d
def test_write_report_with_single_reporter_and_succeed(self): #XXX: verify that the MockOReporter writeReportEntry succeeds report = Report([MockOReporter()], ReportEntryManager()) report.open() d = report.write(MockMeasurement(MockNetTest())) return d