import unittest
from blueprints.settings import testConfig
from blueprints.requestResult import requestResult
from blueprints.tools.asertcase import asertcase
from blueprints.tools.dealCasefile import readCaseFile
class maintest(unittest.TestCase):
   def __init__(self, methodName='runTest', config=None):
       super(maintest, self).__init__(methodName)
       self.config = config
   @staticmethod
   def parametrize(testcase_klass, config=None):
       testloader = unittest.TestLoader()
       testnames = testloader.getTestCaseNames(testcase_klass) 
       suite = unittest.TestSuite()
       for name in testnames:
           print('name====',name)
           suite.addTest(testcase_klass(name, config=config))
       return suite

class trade0(maintest):
   def test_100(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/859.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/859.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_101(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/860.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/860.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_102(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/861.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/861.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_103(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/862.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/862.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_104(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/863.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/863.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_105(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/864.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/864.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_106(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/865.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/865.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_107(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/866.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/866.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)
   def test_108(self):
       res1=requestResult(self.config,'/Users/dm/Desktop/python_script/autoInterface/testCase/trade/867.json')
       res,finalresult=res1.requestJson()
       t=readCaseFile('/Users/dm/Desktop/python_script/autoInterface/testCase/trade/867.json').get('result')
       r=0 if 0 in finalresult and len(finalresult)>0 else 1
       if r:
           self.detail=res1.keyoption()+('Success',)
       else:
           if isinstance(res,dict):
               self.detail=res1.keyoption()+(res.__str__(),)
           elif len(res.text)>5000 :
               self.detail=res1.keyoption()+('响应数据过长',)
           else:
               self.detail=res1.keyoption()+(res.text,)
       if r==0:
           msg='断言失败，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(1, 0,msg=msg)
       else :
           msg='断言成功，预期结果：'+str(t)+',实际结果查看响应数据'
           self.assertEqual(0, 0,msg=msg)

