thirdparty/google_appengine/lib/django/tests/regressiontests/dispatch/tests/test_robustapply.py
changeset 2866 a04b1e4126c4
parent 2864 2e0b0af889be
child 2868 9f7f269383f7
equal deleted inserted replaced
2864:2e0b0af889be 2866:a04b1e4126c4
     1 from django.dispatch.robustapply import *
       
     2 
       
     3 import unittest
       
     4 
       
     5 def noArgument():
       
     6     pass
       
     7 
       
     8 def oneArgument(blah):
       
     9     pass
       
    10 
       
    11 def twoArgument(blah, other):
       
    12     pass
       
    13 
       
    14 class TestCases(unittest.TestCase):
       
    15     def test01(self):
       
    16         robustApply(noArgument)
       
    17     
       
    18     def test02(self):
       
    19         self.assertRaises(TypeError, robustApply, noArgument, "this")
       
    20     
       
    21     def test03(self):
       
    22         self.assertRaises(TypeError, robustApply, oneArgument)
       
    23     
       
    24     def test04(self):
       
    25         """Raise error on duplication of a particular argument"""
       
    26         self.assertRaises(TypeError, robustApply, oneArgument, "this", blah = "that")
       
    27 
       
    28 def getSuite():
       
    29     return unittest.makeSuite(TestCases,'test')
       
    30 
       
    31 
       
    32 if __name__ == "__main__":
       
    33     unittest.main()
       
    34