def setUp(self): self.receiver = StatusReporter() self.sender = StatusReporter(duplicate_reporter=self.receiver)
class TestStatusReporter(ScalyrTestCase): def setUp(self): self.receiver = StatusReporter() self.sender = StatusReporter(duplicate_reporter=self.receiver) def tearDown(self): self.receiver.close() self.sender.close() def test_basic_status(self): self.sender.report_status('My status') self.assertEquals(self.receiver.read_status(timeout=5.0), 'My status') def test_status_with_newlines(self): self.sender.report_status('My status\nAnother one\n') self.assertEquals(self.receiver.read_status(timeout=5.0), 'My status\nAnother one\n') def test_timeout_exceeded(self): self.assertEquals(self.receiver.read_status(timeout=0.0, timeout_status='timeout'), 'timeout') def test_no_timeout(self): self.sender.report_status('My status') self.assertEquals(self.receiver.read_status(), 'My status')
class TestStatusReporter(ScalyrTestCase): def setUp(self): super(TestStatusReporter, self).setUp() self.receiver = StatusReporter() self.sender = StatusReporter(duplicate_reporter=self.receiver) def tearDown(self): self.receiver.close() self.sender.close() def test_basic_status(self): self.sender.report_status("My status") self.assertEquals(self.receiver.read_status(timeout=5.0), "My status") def test_status_with_newlines(self): self.sender.report_status("My status\nAnother one\n") self.assertEquals(self.receiver.read_status(timeout=5.0), "My status\nAnother one\n") def test_timeout_exceeded(self): self.assertEquals( self.receiver.read_status(timeout=0.0, timeout_status="timeout"), "timeout") def test_no_timeout(self): self.sender.report_status("My status") self.assertEquals(self.receiver.read_status(), "My status")
def setUp(self): super(TestStatusReporter, self).setUp() self.receiver = StatusReporter() self.sender = StatusReporter(duplicate_reporter=self.receiver)