def test_futuredisposable_disposeafterset():
    d = SingleAssignmentDisposable()
    disposed = [False]
    
    def action():
        disposed[0] = True

    dd = Disposable(action)
    d.disposable = dd
    assert dd == d.disposable
    assert not disposed[0]
    
    d.dispose()
    assert disposed[0]
    d.dispose()
    assert disposed[0]
dataset/ETHPy150Open ReactiveX/RxPY/tests/test_disposables/test_disposable.py/test_futuredisposable_disposeafterset/original