コード例 #1
0
 def test_1_oneDragon(self):
     # -------------------------首页信息查询(带token和userNo)------------------------------
     urlStr = consts.getEnviron(self.ENV) + consts.APPL_SUMMARY_QUERY
     paramIn = Gatlin.packApplSummaryQueryParam()
     paramIn['userNo'] = self.context['userNo']  # 取上下文的userNo,下同
     paramIn['token'] = self.context['token']
     Gatlin.printParam(json.dumps(paramIn))
     self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
コード例 #2
0
 def test_2_oneDragon(self):
     # -------------------------首页信息查询(带token和userNo)------------------------------
     urlStr = consts.getEnviron(self.ENV) + consts.REFUND_RECORD_QUERY
     paramIn = packRefundRecordQueryParam()
     paramIn['userNo'] = self.context['userNo']  # 取上下文的userNo,下同
     paramIn['token'] = self.context['token']
     Gatlin.printParam(paramIn)
     self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
コード例 #3
0
 def test_3_oneDragon(self):
     # -------------------------补件信息查询(带token和userNo)------------------------------
     urlStr = consts.getEnviron(self.ENV) + consts.SUPPLEMENT_LIST_QUERY
     paramIn = packSupplementlistQWueryParam()
     paramIn['userNo'] = self.context['userNo']  # 取上下文的userNo,下同
     paramIn['token'] = self.context['token']
     paramIn['custNo'] = self.context['custNo']
     Gatlin.printParam(paramIn)
     self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
コード例 #4
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
def packRefundRecordQueryParam(paramIn):
    paramOut = params.genericPackParam()
    paramOut["method"] = consts.REFUND_RECORD_QUERY
    biz = {}
    biz['contractNo'] = paramIn['contractNo']
    biz['custNo'] = paramIn['custNo']
    biz['loanNo'] = paramIn['loanNo']
    biz['mobileNo'] = paramIn['mobileNo']
    paramOut["bizContent"] = str(biz)  # 业务数据
    Gatlin.printParam(paramOut)
    return paramOut
コード例 #5
0
def packSupplementlistQWueryParam():
    paramIn = params.genericPackParam()
    paramIn["method"] = consts.SUPPLEMENT_LIST_QUERY
    biz = {}
    biz['mobileNo'] = '+6308062400111'
    biz['custNo'] = 'CT6829156253144350720'
    biz['loanNo'] = '6829491650026262528'
    biz['contractNo'] = '6829233129166528512'
    paramIn["bizContent"] = str(biz)  # 业务数据
    Gatlin.printParam(paramIn)
    return paramIn
コード例 #6
0
def packRefundRecordQueryParam():
    paramIn = params.genericPackParam()
    paramIn["method"] = consts.REFUND_RECORD_QUERY
    biz = {}
    biz['contractNo'] = '6851471332867129344'
    biz['custNo'] = 'CT6851459341117042688'
    biz['loanNo'] = '6857427969591234560'
    biz['mobileNo'] = '+6308132000071'
    paramIn["bizContent"] = str(biz)  # 业务数据
    Gatlin.printParam(paramIn)
    return paramIn
コード例 #7
0
def packLoginParam(mobile, bytePwd):
    paramIn = params.genericPackParam()
    paramIn["method"] = consts.LOGIN
    biz = {}
    biz['loginType'] = "ORIGIN"
    biz['mobileNo'] = mobile  # 手机号
    biz['password'] = str(security.encrypt(bytePwd), 'utf-8')
    biz['geoInfo'] = str(geo.packGeo())  # 地理geo必传,否则会落库报latitude非空键异常
    paramIn["bizContent"] = str(biz)  # 业务数据
    Gatlin.printParam(paramIn)
    return paramIn
コード例 #8
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
 def stickyWalk(self):
     print("---HERE WE GO!---")
     if not self.curMethod:
         return
     while 1:
         getattr(self, self.curMethod)()
         Gatlin.printReturn(json.loads(self.ret))
         if self.nextMethod:
             self.curMethod = self.nextMethod
         else:
             print("---HERE WE STOP!---")
             break
コード例 #9
0
ファイル: base.py プロジェクト: kokomal/GATLIN
 def call_out(self):
     GLOBAL_ENV = self.context['environ']
     if "mock" in GLOBAL_ENV and GLOBAL_ENV["mock"]:  # mock开关打开
         return
     ENV = self.context['environ']['env']
     METHOD = self.context['environ']['nodeName']
     url_str = consts.getEnviron(ENV) + consts.getMethod(METHOD)
     res = Gatlin.myJsonPost(url_str, self.context['request'])
     self.context['response'] = json.loads(res.text)
コード例 #10
0
 def setUpClass(self):
     print('STARTING...')
     self.ENV = "PH_DEV"  # ~~~~~~~~~~~~~~~~~~~~~~这里改环境!!!~~~~~~~~~~~~~~~~~~~~~~
     security.init(self.ENV)  # 初始化加密的公私钥
     self.context = {}  # 初始化上下文
     loginPrepare = packLoginParam(
         '+6308062400111',
         b'123456')  # ~~~~~~~~~~~~~~~~~~~~~~这里改用户!!!~~~~~~~~~~~~~~~~~~~~~~
     urlStr = consts.getEnviron(self.ENV) + consts.LOGIN
     res = Gatlin.myJsonPost(urlStr, loginPrepare)
     retJson = json.loads(res.text)
     Gatlin.get_pretty_print(retJson)
     token = retJson['data']['token']
     userNo = retJson['data']['userNo']  # 获得userNo
     mobileNo = retJson['data']['mobileNo']  # 获得mobileNo
     custNo = retJson['data']['custNo']  # 获得mobileNo
     print("Fetch LOGIN Token", token)
     self.context['token'] = token  # token放入上下文
     self.context['userNo'] = userNo  # userNo放入上下文
     self.context['mobileNo'] = mobileNo  # userNo放入上下文
     self.context['custNo'] = custNo  # userNo放入上下文
コード例 #11
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
 def myInit(self):
     print('STARTING...')
     self.ENV = self.paramIn['environ']
     security.init(self.ENV)  # 初始化加密的公私钥
     self.context = {}  # 初始化上下文
     loginPrepare = packLoginParam(self.paramIn)
     urlStr = consts.getEnviron(self.ENV) + consts.LOGIN
     res = Gatlin.myJsonPost(urlStr, loginPrepare)
     retJson = json.loads(res.text)
     token = retJson['data']['token']
     userNo = retJson['data']['userNo']  # 获得userNo
     print("Fetch LOGIN Token", token)
     self.context['token'] = token  # token放入上下文
     self.context['userNo'] = userNo  # userNo放入上下文
     self.curMethod = "biz1"
コード例 #12
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
 def myInit(self):
     print('STARTING...')
     self.ENV = self.paramIn['env']
     security.init(self.ENV)  # 初始化加密的公私钥
     self.context = {}  # 初始化上下文
     regPrepare = packRegisterParam(self.paramIn)
     print(regPrepare)
     urlStr = consts.getEnviron(self.ENV) + consts.REGISTER
     res = Gatlin.myJsonPost(urlStr, regPrepare)
     retJson = json.loads(res.text)
     print(retJson)
     token = retJson['data']['token']
     userNo = retJson['data']['userNo']  # 获得userNo
     print("Fetch REGISTER Token", token)
     self.context['token'] = token  # token放入上下文
     self.context['userNo'] = userNo  # userNo放入上下文
     self.curMethod = "biz4"
コード例 #13
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
 def mandatoryWalk(self, orderMethods):
     print("---MANDATORY BEGINS---")
     for orderMethod in orderMethods:
         getattr(self, orderMethod)()
         Gatlin.printReturn(json.loads(self.ret))
     print("---MANDATORY ENDS---")
コード例 #14
0
ファイル: frame.py プロジェクト: kokomal/GATLIN
 def refundRecordQuery(self):
     refundPrepare = packRefundRecordQueryParam(self.paramIn)
     urlStr = consts.getEnviron(self.ENV) + consts.REFUND_RECORD_QUERY
     self.ret = Gatlin.myJsonPost(urlStr, refundPrepare).text
コード例 #15
0
 def tearDown(self):
     # 每个测试用例执行之后做操作
     Gatlin.printReturn(self.ret)
     print('=' * 150)