File: test_robustapply.py

package info (click to toggle)
pydispatcher 2.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 496 kB
  • sloc: python: 1,076; makefile: 11
file content (27 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from pydispatch.robustapply import *

import unittest
def noArgument():
    pass
def oneArgument (blah):
    pass
def twoArgument(blah, other):
    pass
class TestCases( unittest.TestCase ):
    def test01( self ):
        robustApply(noArgument )
    def test02( self ):
        self.assertRaises( TypeError, robustApply, noArgument, "this" )
    def test03( self ):
        self.assertRaises( TypeError, robustApply, oneArgument )
    def test04( self ):
        """Raise error on duplication of a particular argument"""
        self.assertRaises( TypeError, robustApply, oneArgument, "this", blah = "that" )

def getSuite():
    return unittest.makeSuite(TestCases,'test')


if __name__ == "__main__":
    unittest.main()