Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > 907e63cf471523ddf7adab61d948a8e1 > files > 9

python-dispatch-examples-1.0.2-4.noarch.rpm

from dispatch.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()