Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(2)  |  Derive(2)  |  Import(2)

src/d/u/dupeguru-HEAD/hscommon/tests/notify_test.py   dupeguru(Download)
 
from ..testutil import eq_
from ..notify import Broadcaster, Listener, Repeater
 
class HelloListener(Listener):
class HelloRepeater(Repeater):
    def __init__(self, broadcaster):
        Repeater.__init__(self, broadcaster)
        self.hello_count = 0
 
def test_repeater_doesnt_try_to_dispatch_to_self_if_it_cant():
    # if a repeater doesn't handle a particular message, it doesn't crash and simply repeats it.
    b = Broadcaster()
    r = Repeater(b) # doesnt handle hello
    l = HelloListener(r)

src/m/o/moneyguru-HEAD/hscommon/tests/notify_test.py   moneyguru(Download)
 
from ..testutil import eq_
from ..notify import Broadcaster, Listener, Repeater
 
class HelloListener(Listener):
class HelloRepeater(Repeater):
    def __init__(self, broadcaster):
        Repeater.__init__(self, broadcaster)
        self.hello_count = 0
 
def test_repeater_doesnt_try_to_dispatch_to_self_if_it_cant():
    # if a repeater doesn't handle a particular message, it doesn't crash and simply repeats it.
    b = Broadcaster()
    r = Repeater(b) # doesnt handle hello
    l = HelloListener(r)