00001
00002 import unittest
00003 from ZSI import *
00004 from ZSI.wstools.logging import setBasicLoggerDEBUG
00005 setBasicLoggerDEBUG()
00006
00007 class t3TestCase(unittest.TestCase):
00008 "Test case wrapper for old ZSI t3 test case"
00009
00010 def checkt3(self):
00011 a = None
00012 try:
00013 3 / 0
00014 except Exception, e:
00015 a = e
00016 f = FaultFromException(a, 0)
00017 text = f.AsSOAP()
00018 i = 0
00019 for l in text.split('\n'):
00020 print i, l
00021 i += 1
00022 ps = ParsedSoap(text)
00023 if ps.IsAFault():
00024 f = FaultFromFaultMessage(ps)
00025 print f.AsSOAP()
00026 self.failUnless(f.AsSOAP().find(str(a)) > 0)
00027 print '--'*20
00028
00029
00030 def makeTestSuite():
00031 suite = unittest.TestSuite()
00032 suite.addTest(unittest.makeSuite(t3TestCase, "check"))
00033 return suite
00034
00035 def main():
00036 unittest.main(defaultTest="makeTestSuite")
00037
00038
00039 if __name__ == "__main__" : main()
00040
00041