<s> import suds <EOL> import unittest2 as unittest <EOL> from testcases . base import BaseTestCaseMixin <EOL> class RaisesExceptionTestCase ( BaseTestCaseMixin , unittest . TestCase ) : <EOL> def test_simple ( self ) : <EOL> headers = self . factory . create ( '<STR_LIT>' ) <EOL> headers . username = '<STR_LIT:user>' <EOL> headers . password = '<STR_LIT>' <EOL> self . client . set_options ( soapheaders = headers ) <EOL> self . assertEqual ( self . service . say_hello ( ) , '<STR_LIT>' ) <EOL> def _test_exception ( self , message ) : <EOL> try : <EOL> self . service . say_hello ( ) <EOL> except suds . WebFault , e : <EOL> self . assertEqual ( e . fault . faultstring , message ) <EOL> return <EOL> self . assertTrue ( False , '<STR_LIT>' ) <EOL> def test_none_exception ( self ) : <EOL> self . _test_exception ( '<STR_LIT>' ) <EOL> def test_exception ( self ) : <EOL> headers = self . factory . create ( '<STR_LIT>' ) <EOL> headers . username = '<STR_LIT>' <EOL> headers . password = '<STR_LIT>' <EOL> self . client . set_options ( soapheaders = headers ) <EOL> self . _test_exception ( '<STR_LIT>' ) </s>
