def METHOD_NAME(self):
    """test StreamWorker with timeout set (event based)"""
    class TestH(EventHandler):
        def __init__(self, testcase):
            self.testcase = testcase
            self.ev_pickup_called = False
            self.ev_read_called = False
            self.ev_hup_called = False
            self.ev_timeout_called = False
        def ev_pickup(self, worker):
            self.ev_pickup_called = True
        def ev_read(self, worker):
            self.ev_read_called = True
            self.testcase.assertEqual(worker.current_sname, "pipe1")
            self.testcase.assertEqual(worker.current_msg, "Some data")
        def ev_hup(self, worker):
            # ev_hup is called but no rc code should be set
            self.ev_hup_called = True
            self.testcase.assertEqual(worker.current_rc, None)
        def ev_timeout(self, worker):
            self.ev_timeout_called = True
    hdlr = TestH(self)
    worker = StreamWorker(handler=hdlr, timeout=0.5)
    # Create pipe stream with closefd set (default)
    rfd1, wfd1 = os.pipe()
    worker.set_reader("pipe1", rfd1)
    # Write some chars without line break (worst case)
    os.write(wfd1, "Some data")
    # TEST: Do not close wfd1 to simulate open stream
    self.run_worker(worker)
    self.assertTrue(hdlr.ev_timeout_called)
    self.assertTrue(hdlr.ev_read_called)
    self.assertTrue(hdlr.ev_pickup_called)
    self.assertTrue(hdlr.ev_hup_called)
    # rfd1 should be already closed by CS
    self.assertRaises(OSError, os.close, rfd1)
    os.close(wfd1)