def test_to_observer_notification_completed():
    i = 0

    def next(n):
        assert(i == 0)
        assert(n.kind == 'C')
        assert(not n.has_value)

    from_notifier(next).on_completed()
Beispiel #2
0
def test_to_observer_notification_completed():
    i = 0

    def next(n):
        assert (i == 0)
        assert (n.kind == 'C')
        assert (not n.has_value)

    from_notifier(next).on_completed()
def test_to_observer_notification_on_error():
    ex = 'ex'
    i = 0

    def next(n):
        assert(i == 0)
        assert(n.kind == 'E')
        assert(n.exception == ex)
        assert(not n.has_value)

    from_notifier(next).on_error(ex)
def test_to_observer_notification_on_next():
    i = 0

    def next(n):
        assert(i == 0)
        assert(n.kind == 'N')
        assert(n.value == 42)
        assert(not hasattr(n, "exception"))
        assert(n.has_value)

    from_notifier(next).on_next(42)
Beispiel #5
0
def test_to_observer_notification_on_error():
    ex = 'ex'
    i = 0

    def next(n):
        assert (i == 0)
        assert (n.kind == 'E')
        assert (n.exception == ex)
        assert (not n.has_value)

    from_notifier(next).on_error(ex)
Beispiel #6
0
def test_to_observer_notification_on_next():
    i = 0

    def next(n):
        assert (i == 0)
        assert (n.kind == 'N')
        assert (n.value == 42)
        assert (not hasattr(n, "exception"))
        assert (n.has_value)

    from_notifier(next).on_next(42)