コード例 #1
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_with_keywords_1(self):
        callable = lambda **keywords: None
        keywords = {'a': 1, 'b': 2}

        self.assert_(Binding.wrap(callable, keywords=keywords) is not callable)
        self.assert_(
            WeakBinding.wrap(callable, keywords=keywords) is not callable)
        self.assert_(
            RaisingWeakBinding.wrap(callable, keywords=keywords)
            is not callable)
コード例 #2
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_with_arguments_1(self):
        callable = lambda a, b, c: None

        self.assert_(Binding.wrap(callable, (1, 2)) is not callable)
        self.assert_(WeakBinding.wrap(callable, (1, 2)) is not callable)
        self.assert_(RaisingWeakBinding.wrap(callable, (1, 2)) is not callable)
コード例 #3
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_4(self):
        callable = Dummy.static_identity

        self.assert_(Binding.wrap(callable) is callable)
        self.assert_(WeakBinding.wrap(callable) is callable)
        self.assert_(RaisingWeakBinding.wrap(callable) is callable)
コード例 #4
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_3(self):
        callable = Dummy.identity_function

        self.assert_(Binding.wrap(callable) is callable)
        self.assert_(WeakBinding.wrap(callable) is callable)
        self.assert_(RaisingWeakBinding.wrap(callable) is callable)
コード例 #5
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_2(self):
        callable = open

        self.assert_(Binding.wrap(callable) is callable)
        self.assert_(WeakBinding.wrap(callable) is callable)
        self.assert_(RaisingWeakBinding.wrap(callable) is callable)
コード例 #6
0
ファイル: bind.py プロジェクト: brmed/py-notify
    def test_wrap_1(self):
        callable = lambda: None

        self.assert_(Binding.wrap(callable) is callable)
        self.assert_(WeakBinding.wrap(callable) is callable)
        self.assert_(RaisingWeakBinding.wrap(callable) is callable)