def test_simple_subscriptions(self):
        sig = signals.Signal('FOO', ('a', 'b'))
        self.assertEqual(repr(sig), 'FOO')
        self.assertEqual(sig.args, ('a', 'b'))

        called = []
        def foo(a, b):
            called.append((a, b))

        sig.emit(a=1, b=2)
        self.assertEqual(called, [])

        sig.connect(foo)
        sig.emit(a=1, b=2)
        self.assertEqual(called, [(1, 2)])

        del foo
        gc.collect()

        sig.emit(a=3, b=4)
        self.assertEqual(called, [(1, 2)])
Simple signal subscriptions
dataset/ETHPy150Open mitsuhiko/solace/solace/tests/signals.py/SignalTestCase.test_simple_subscriptions