

def test_mutabledisposable_replaceafterdispose():
    disp1 = [False]
    disp2 = [False]
    m = SerialDisposable()
    m.dispose()

    def action1():
        disp1[0] = True
    d1 = Disposable(action1)
    m.disposable = d1
    assert (m.disposable == None)
    assert disp1[0]

    def action2():
        disp2[0] = True
    d2 = Disposable(action2)
    m.disposable = d2
    assert (m.disposable == None)
    assert disp2[0]

dataset/ETHPy150Open ReactiveX/RxPY/tests/test_disposables/test_disposable.py test_mutabledisposable_replaceafterdispose/original