Exemple #1
0
    def test_disconnect_from_removes_all(self):
        # Register first
        smokesignal.on(('foo', 'bar'), self.fn)
        assert smokesignal.responds_to(self.fn, 'foo')
        assert smokesignal.responds_to(self.fn, 'bar')

        # Remove it
        smokesignal.disconnect_from(self.fn, ('foo', 'bar'))
        assert not smokesignal.responds_to(self.fn, 'foo')
        assert not smokesignal.responds_to(self.fn, 'bar')
Exemple #2
0
    def test_disconnect_from_removes_only_one(self):
        # Register first
        smokesignal.on(('foo', 'bar'), self.callback)
        assert smokesignal.responds_to(self.callback, 'foo')
        assert smokesignal.responds_to(self.callback, 'bar')

        # Remove it
        smokesignal.disconnect_from(self.callback, 'foo')
        assert not smokesignal.responds_to(self.callback, 'foo')
        assert smokesignal.responds_to(self.callback, 'bar')
Exemple #3
0
    def test_disconnect_from_removes_all(self):
        # Register first
        smokesignal.on(('foo', 'bar'), self.callback)
        assert smokesignal.responds_to(self.callback, 'foo')
        assert smokesignal.responds_to(self.callback, 'bar')

        # Remove it
        smokesignal.disconnect_from(self.callback, ('foo', 'bar'))
        assert not smokesignal.responds_to(self.callback, 'foo')
        assert not smokesignal.responds_to(self.callback, 'bar')
Exemple #4
0
    def test_disconnect_from_removes_only_one(self):
        # Register first
        smokesignal.on(('foo', 'bar'), self.fn)
        assert smokesignal.responds_to(self.fn, 'foo')
        assert smokesignal.responds_to(self.fn, 'bar')

        # Remove it
        smokesignal.disconnect_from(self.fn, 'foo')
        assert not smokesignal.responds_to(self.fn, 'foo')
        assert smokesignal.responds_to(self.fn, 'bar')