import sys sys.path.insert(1, "..") from SOAPpy import * detailed_fault = \ """ soapenv:Server.generalException Exception thrown on Server ... Login failure (504):Unknown User ... ... ... ... """ z = parseSOAPRPC(detailed_fault.strip() ) assert(z.__class__==faultType) assert(z.faultstring=="Exception thrown on Server") assert(z.detail.loginFailureFault.description=='Login failure (504):Unknown User') print("Success")