Example #1
0
def test_on_completed_accept_action():
    obs = [False]
    n1 = OnCompleted()

    def on_next(x):
        assert(False)
        return None
    def on_error(ex):
        assert(False)
        return None
    def on_completed():
        obs[0] = True
        return obs[0]

    n1.accept(on_next, on_error, on_completed) 
    assert(obs[0])
def test_on_completed_accept_action():
    obs = False
    n1 = OnCompleted()

    def on_next(x):
        assert(False)
        return None
    def on_error(ex):
        assert(False)
        return None
    def on_completed():
        nonlocal obs
        obs = True
        return obs

    n1.accept(on_next, on_error, on_completed) 
    assert(obs)
Example #3
0
def test_on_completed_accept_action():
    obs = [False]
    n1 = OnCompleted()

    def on_next(x):
        assert (False)
        return None

    def on_error(ex):
        assert (False)
        return None

    def on_completed():
        obs[0] = True
        return obs[0]

    n1.accept(on_next, on_error, on_completed)
    assert (obs[0])
def test_on_completed_accept_action():
    obs = False
    n1 = OnCompleted()

    def on_next(x):
        assert (False)
        return None

    def on_error(ex):
        assert (False)
        return None

    def on_completed():
        nonlocal obs
        obs = True
        return obs

    n1.accept(on_next, on_error, on_completed)
    assert (obs)
Example #5
0
def test_on_completed_accept_action_with_result():
    n1 = OnCompleted()

    def on_next(x):
        assert(False)
        return None
    def on_error(ex):
        assert(False)
        return None
    def on_completed():
        return "OK"

    res = n1.accept(on_next, on_error, on_completed)    
    assert('OK' == res)
Example #6
0
def test_on_completed_accept_action_with_result():
    n1 = OnCompleted()

    def on_next(x):
        assert (False)
        return None

    def on_error(ex):
        assert (False)
        return None

    def on_completed():
        return "OK"

    res = n1.accept(on_next, on_error, on_completed)
    assert ('OK' == res)
Example #7
0
def test_on_completed_accept_observer():
    obs = CheckOnCompletedObserver()
    n1 = OnCompleted()
    n1.accept(obs)
    assert(obs.completed)
Example #8
0
def test_on_completed_accept_observer():
    obs = CheckOnCompletedObserver()
    n1 = OnCompleted()
    n1.accept(obs)
    assert (obs.completed)