コード例 #1
0
    def test_link_repr_chain_all(self):
        def function():
            pass

        self.assertEqual(
            repr(Link(Any(), LinkAction.stop, AcceptChain(), function)),
            '<Link "if any then LinkAction.stop" accept function()>')
コード例 #2
0
    def test_link_repr_chain_and_function(self):
        def function():
            pass

        self.assertEqual(
            repr(Link(Any(), chain=AcceptChain(), function=function)),
            '<Link "if any then LinkAction.defer" accept function()>')
コード例 #3
0
ファイル: test_base.py プロジェクト: inonit/mailman
 def test_flush(self):
     # Test that we can flush the links of a chain.
     chain = Chain('test', 'just a testing chain')
     chain.append_link(Link(Any()))
     # Iterate over the links of the chain to prove there are some.
     count = sum(1 for link in chain.get_iterator())
     self.assertEqual(count, 1)
     # Flush the chain; then there will be no links.
     chain.flush()
     count = sum(1 for link in chain.get_iterator())
     self.assertEqual(count, 0)
コード例 #4
0
ファイル: test_base.py プロジェクト: inonit/mailman
 def test_link_repr_chain(self):
     self.assertEqual(
         repr(Link(Any(), chain=AcceptChain())),
         '<Link "if any then LinkAction.defer" accept>')
コード例 #5
0
ファイル: test_base.py プロジェクト: inonit/mailman
 def test_link_repr_function(self):
     def function():
         pass
     self.assertEqual(
         repr(Link(Any(), function=function)),
         '<Link "if any then LinkAction.defer" function()>')
コード例 #6
0
ファイル: test_base.py プロジェクト: inonit/mailman
 def test_link_repr(self):
     self.assertEqual(
         repr(Link(Any())), '<Link "if any then LinkAction.defer">')