def testBasicCallWithClass(self): stub = LocalService.Stub(transport.LocalTransport(LocalService)) response = stub.call_method(content='Hello') self.assertEquals( SimpleResponse(content='Hello', factory_value='default', remote_host=os.uname()[1], remote_address='127.0.0.1', server_host=os.uname()[1], server_port=-1), response)
def testApplicationError(self): stub = LocalService.Stub(transport.LocalTransport(LocalService)) self.assertRaisesWithRegexpMatch(remote.ApplicationError, 'App error', stub.raise_application_error)
def testUnexpectedError(self): stub = LocalService.Stub(transport.LocalTransport(LocalService)) self.assertRaisesWithRegexpMatch( remote.ServerError, 'Unexpected error RequestError: Huh?', stub.raise_unexpected)
def testTotallyUnexpectedError(self): stub = LocalService.Stub(transport.LocalTransport(LocalService)) self.assertRaisesWithRegexpMatch(remote.ServerError, 'Unexpected error TypeError: Kablam', stub.raise_totally_unexpected)