

def test_on_error_resume_next_start_with_factory(self):
    scheduler = TestScheduler()
    msgs1 = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_error(230, 'ex')]
    o1 = scheduler.create_hot_observable(msgs1)

    def factory(ex):
        assert (ex == 'ex')
        msgs2 = [on_next(240, 4), on_completed(250)]
        o2 = scheduler.create_hot_observable(msgs2)
        return o2

    def create():
        return Observable.on_error_resume_next(o1, factory)
    results = scheduler.start(create)
    results.messages.assert_equal(on_next(210, 2), on_next(220, 3), on_next(240, 4), on_completed(250))

dataset/ETHPy150Open ReactiveX/RxPY/tests/test_observable/test_onerrorresumenext.py TestOnErrorResumeNext.test_on_error_resume_next_start_with_factory/original