Ejemplo n.º 1
0
 def test_9_getAnnexList(self):
     '''成教学员获取附件ID'''
     extFile = YamlParser('LearnInfo')
     intFile = YamlParser('StudentInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     recruitType = intFile.getYamlParms(('CJ', 'recruitType'))
     case = TestCaseAssembly().setAipParam('getAnnexList',
                                           (learnId, recruitType),
                                           (('data', 'learnId'),
                                            ('data', 'recruitType')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数annexId'''
     resJosn = getJsonParm(response.text, 'body')
     annexId1 = resJosn['data'][0]['annexId']
     annexId2 = resJosn['data'][1]['annexId']
     annexId3 = resJosn['data'][2]['annexId']
     annexId4 = resJosn['data'][3]['annexId']
     BeforeParamCom().setLearn((('CStudent', 'annexId1'), ), annexId1)
     BeforeParamCom().setLearn((('CStudent', 'annexId2'), ), annexId2)
     BeforeParamCom().setLearn((('CStudent', 'annexId3'), ), annexId3)
     BeforeParamCom().setLearn((('CStudent', 'annexId4'), ), annexId4)
    def test_7_cj_fd_pay(self):
        '''成教学员支付辅导费(不使用抵扣)'''
        extFile = YamlParser('LearnInfo')
        intFile = YamlParser('StudentInfo')
        '''提取到的'''
        order = extFile.getYamlParms(('CStudent', 'order'))
        learnId = extFile.getYamlParms(('CStudent', 'learnId'))
        web_token = extFile.getYamlParms(('CStudent', '_web_token'))
        tutorPayInfos = getJsonParm(order, 'tutorPayInfos')[0]
        payAmount = payableCount = amount = tutorPayInfos['payable']
        itemName = tutorPayInfos['itemName']
        orderNo = tutorPayInfos['subOrderNo']
        paymentType = 1
        '''配置的'''
        grade = intFile.getYamlParms(('CJ', 'grade'))
        values = (str(learnId), str(learnId), str(web_token), str(grade), str(grade), str(payableCount), str(payAmount), str(amount),
                  str(itemName), str(orderNo), str(paymentType))
        keys = (('data', 'learnId'), ('data', 'payData', 'learnId'), ('data', '_web_token'), ('data', 'grade'),
                ('data', 'payData', 'grade'), ('data', 'payableCount'), ('data', 'payData', 'payAmount'), ('data', 'payData', 'items', 0, 'amount'),
                ('data', 'payData', 'items', 0, 'itemName'), ('data', 'payData', 'items', 0, 'orderNo'), ('data',  'paymentType'))

        case = TestCaseAssembly().setAipParam('pay', values, keys)
        case[3]['payData']=str(case[3]['payData'])
        response = YzApi().lapi(method=case[0], headers=DataSource().getHearder("PHearder"), urls=case[2], data=case[3])
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
        '''提取参数:subOrderNo'''
        DataSource().setLearnInfo('CStudent','subOrderNo',orderNo)
 def test_4_CrecruitAdd(self):
     '''随机注册成教学员'''
     extFile = YamlParser('LearnInfo')
     intFile = YamlParser('StudentInfo')
     '''提取到的'''
     unvsid = extFile.getYamlParms(('CStudent', 'unvsId'))
     pfsnId = extFile.getYamlParms(('CStudent', 'pfsnId'))
     taId = extFile.getYamlParms(('CStudent', 'taId'))
     feeList = extFile.getYamlParms(('CStudent', 'feeList'))
     '''配置的'''
     scholarship = intFile.getYamlParms(('CJ', 'scholarships'))
     recruitType = intFile.getYamlParms(('CJ', 'recruitType'))
     grade = intFile.getYamlParms(('CJ', 'grade'))
     pfsnLevel = intFile.getYamlParms(('CJ', 'level'))
     mobile = BeforeParamCom().getPhone()
     idCard = BeforeParamCom().getCard()
     self.log.info('学员手机号:'+mobile)
     self.log.info('学员身份证号:'+idCard)
     BeforeParamCom().setLearn((('CStudent', 'mobile'),), mobile)
     BeforeParamCom().setLearn((('CStudent', 'idCard'),), idCard)
     values = (str(unvsid), str(pfsnId), str(taId), str(feeList), str(scholarship), str(recruitType), str(grade), str(pfsnLevel), str(mobile), str(idCard))
     keys = (('data', 'unvsId'), ('data', 'pfsnid'), ('data', 'taId'), ('data', 'feeList'), ('data', 'scholarship')
             , ('data', 'recruitType'), ('data', 'grade'), ('data', 'pfsnLevel'), ('data', 'mobile'), ('data', 'idCard'))
     case = TestCaseAssembly().setAipParam('CrecruitAdd', values, keys)
     data = MultipartEncoder(fields=case[3])
     DataSource().setHearder(data.content_type)
     response = YzApi().lapi(method=case[0], headers=DataSource().getHearder("regiester"), urls=case[2], data=data)
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
Ejemplo n.º 4
0
    def test_I_updateStudentScore(self):
        '''成教学员入学考试成绩录入'''
        extFile = YamlParser('LearnInfo')
        learnId = extFile.getYamlParms(('CStudent', 'learnId'))
        web_token = extFile.getYamlParms(('CStudent', '_web_token'))
        courses = extFile.getYamlParms(('CStudent', 'courses'))
        param = getJsonParm(courses)
        courseId0 = param[0]['subjectId']
        courseName0 = param[0]['subjectName']
        courseId1 = param[1]['subjectId']
        courseName1 = param[1]['subjectName']
        courseId2 = param[2]['subjectId']
        courseName2 = param[2]['subjectName']

        case = TestCaseAssembly().setAipParam(
            'updateStudentScore',
            (learnId, web_token, courseId0, courseName0, courseId1,
             courseName1, courseId2, courseName2),
            (('data', 'learnId'), ('data', '_web_token'),
             ('data', 'scores[0].courseId'), ('data', 'scores[0].courseName'),
             ('data', 'scores[1].courseId'), ('data', 'scores[1].courseName'),
             ('data', 'scores[2].courseId'), ('data', 'scores[2].courseName')))
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
 def test_0_sUnvs(self):
     '''随机获取成教院校ID'''
     intFile = YamlParser('StudentInfo')
     case = TestCaseAssembly().setAipParam('sUnvs', (intFile.getYamlParms(('CJ', 'recruitType')),), ('data', 'ext1'))
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'sUnvs', ('CStudent', 'unvsId'))
 def test_8_reviewFee(self):
     '''成教学员辅导费缴费审核'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     subOrderNo = extFile.getYamlParms(('CStudent', 'subOrderNo'))
     case = TestCaseAssembly().setAipParam('reviewFee', (learnId,subOrderNo), (('data', 'learnId'),('data', 'subOrderNo')))
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
 def test_6_toPay(self):
     '''获取支付订单及web_token'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     case = TestCaseAssembly().setAipParam('toPay', (learnId,), (('data', 'learnId'),))
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     '''提取参数learnId'''
     AfterParamCom().moreParam(response.text, 'toPay', (('CStudent', 'order'), ('CStudent', '_web_token')))
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
 def test_2_getOpenTestAreaByCity(self):
     '''随机获取考区'''
     extFile = YamlParser('LearnInfo')
     pfsnId = extFile.getYamlParms(('CStudent', 'pfsnId'))
     values = (pfsnId,)
     keys = (('data', 'sId'),)
     case = TestCaseAssembly().setAipParam('sTaNotStop', values, keys)
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'sTaNotStop', ('CStudent', 'taId'))
Ejemplo n.º 9
0
 def test_E_testConfirm_okConfirm(self):
     '''成教学员考前确认'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     case = TestCaseAssembly().setAipParam('okConfirm', (learnId, ),
                                           (('data', 'learnId'), ))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
 def test_1_sPfsnByOnScholarship(self):
     '''随机获取成教专业'''
     intFile = YamlParser('StudentInfo')
     extFile = YamlParser('LearnInfo')
     grade = intFile.getYamlParms(('CJ', 'grade'))
     level = intFile.getYamlParms(('CJ', 'level'))
     sId = extFile.getYamlParms(('CStudent', 'unvsId'))
     values = (grade, level, sId)
     keys = (('data', 'ext2'), ('data', 'ext1'), ('data', 'sId'))
     case = TestCaseAssembly().setAipParam('sPfsnByOnScholarship', values, keys)
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True,)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'sPfsnByOnScholarship', ('CStudent', 'pfsnId'))
 def test_5_stdFeeList(self):
     '''财务管理搜索结果获取learn_id'''
     extFile = YamlParser('LearnInfo')
     mobile = extFile.getYamlParms(('CStudent', 'mobile'))
     values = (mobile,)
     keys = (('data', 'mobile'),)
     case = TestCaseAssembly().setAipParam('stdFeeList', values, keys)
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     '''提取参数learnId'''
     resJosn = getJsonParm(response.text, 'body')
     learnId = str(resJosn['data'][0]['learnId'])
     BeforeParamCom().setLearn((('CStudent', 'learnId'),), learnId)
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
    def test_f_studentModify_passStudentAuditModify(self):
        '''成教学员新生信息修改提交申请随'''

        extFile = YamlParser('LearnInfo')
        modifyId = extFile.getYamlParms(('CStudent', 'modifyId'))
        case = TestCaseAssembly().setAipParam('passStudentAuditModify',
                                              (modifyId, ),
                                              (('data', 'modifyId'), ))
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
 def test_3_showFeeList(self):
     '''获取收费标准'''
     extFile = YamlParser('LearnInfo')
     intFile = YamlParser('StudentInfo')
     pfsnId = extFile.getYamlParms(('CStudent', 'pfsnId'))
     taId = extFile.getYamlParms(('CStudent', 'taId'))
     recruitType = intFile.getYamlParms(('CJ', 'recruitType'))
     scholarship = intFile.getYamlParms(('CJ', 'scholarships'))
     values = (pfsnId, taId, recruitType, scholarship)
     keys = (('data', 'pfsnId'), ('data', 'taId'), ('data', 'recruitType'), ('data', 'scholarship'))
     case = TestCaseAssembly().setAipParam('showFeeList', values, keys)
     response = YzApi().lapi(method=case[0], headers=case[1], urls=case[2], data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']), True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'showFeeList', ('CStudent', 'feeList'))
 def test_0_getGkOpenEnrollCityInfo(self):
     '''随机获取国开报读城市'''
     intFile = YamlParser('StudentInfo')
     case = TestCaseAssembly().setAipParam(
         'getGkOpenEnrollCityInfo', (intFile.getYamlParms(
             ('GK', 'grade'), ), intFile.getYamlParms(
                 ('GK', 'level'))), (('data', 'ext2'), ('data', 'ext1')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'getGkOpenEnrollCityInfo',
                               ('GStudent', 'city'))
    def test_5_gk_normal_register(self):
        '''随机录入国开类型学员学员'''
        intFile = YamlParser('StudentInfo')
        extFile = YamlParser('LearnInfo')
        '''从配置文件获取参数'''
        grade = intFile.getYamlParms(('GK', 'grade'))
        recruitType = intFile.getYamlParms(('GK', 'recruitType'))
        scholarship = intFile.getYamlParms(('GK', 'scholarships'))
        '''从参数文件获取参数'''
        city = extFile.getYamlParms(('GStudent', 'city'))
        unvsId = extFile.getYamlParms(('GStudent', 'unvsId'))
        feeId = extFile.getYamlParms(('GStudent', 'feeId'))
        feeList = extFile.getYamlParms(('GStudent', 'feeList'))
        pfsnCode = extFile.getYamlParms(('GStudent', 'pfsnCode'))
        pfsnId = extFile.getYamlParms(('GStudent', 'pfsnId'))
        pfsnName = extFile.getYamlParms(('GStudent', 'pfsnName'))
        taId = extFile.getYamlParms(('GStudent', 'taId'))
        taName = extFile.getYamlParms(('GStudent', 'taName'))
        mobile = BeforeParamCom().getPhone()
        idCard = BeforeParamCom().getCard()
        self.log.info('学员手机号:' + mobile)
        self.log.info('学员身份证号:' + idCard)
        BeforeParamCom().setLearn((('GStudent', 'mobile'), ), mobile)
        BeforeParamCom().setLearn((('GStudent', 'idCard'), ), idCard)

        pfsnLevel = intFile.getYamlParms(('GK', 'pfsnLevel'))
        '''将参数组合到接口文件'''
        values = (str(grade), str(recruitType), str(scholarship), str(city),
                  str(unvsId), str(feeList), str(pfsnCode), str(pfsnId),
                  str(pfsnName), str(taId), str(taName), mobile, idCard,
                  str(pfsnLevel), str(feeId))
        keys = (('data', 'grade'), ('data', 'recruitType'), ('data',
                                                             'scholarship'),
                ('data', 'city'), ('data', 'unvsId'), ('data', 'feeList'),
                ('data', 'pfsnCode'), ('data', 'pfsnId'), ('data', 'pfsnName'),
                ('data', 'taId'), ('data', 'taName'), ('data', 'mobile'),
                ('data', 'idCard'), ('data', 'pfsnLevel'), ('data', 'feeId'))
        case = TestCaseAssembly().setAipParam('GrecruitAdd', values, keys,
                                              'regiester')
        data = MultipartEncoder(fields=case[3])
        DataSource().setHearder(data.content_type)
        response = YzApi().lapi(method=case[0],
                                headers=DataSource().getHearder("regiester"),
                                urls=case[2],
                                data=data)
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
 def test_9_studentModify_findStudentEnrollInfo(self):
     '''成教学员获取新生信息修改基础数据'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     case = TestCaseAssembly().setAipParam('findStudentEnrollInfo',
                                           (learnId, ),
                                           (('data', 'learnId'), ))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数'''
     TxJosn = getJsonParm(response.text, 'body')
     BeforeParamCom().setLearn((('CStudent', 'TxJosn'), ), TxJosn)
 def test_e_studentModify_findStudentAuditModify(self):
     '''成教学员新生信息修改申请随机获取新考区id'''
     extFile = YamlParser('LearnInfo')
     mobile = extFile.getYamlParms(('CStudent', 'mobile'))
     case = TestCaseAssembly().setAipParam('findStudentAuditModify',
                                           (mobile, ),
                                           (('data', 'mobile'), ))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数modifyId'''
     AfterParamCom().saveParam(response.text, 'findStudentAuditModify',
                               ('CStudent', 'modifyId'))
Ejemplo n.º 18
0
 def test_B_getCommonAnnexList(self):
     '''成教学员获取附件审核crId'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'idCard'))
     case = TestCaseAssembly().setAipParam('getCommonAnnexList',
                                           (learnId, ),
                                           (('data', 'idCard'), ))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数crId'''
     AfterParamCom().saveParam(response.text, 'getCommonAnnexList',
                               ('CStudent', 'crId'))
Ejemplo n.º 19
0
 def test_A_updateAnnex(self):
     '''成教学员上传附件'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     annexId1 = extFile.getYamlParms(('CStudent', 'annexId1'))
     annexId2 = extFile.getYamlParms(('CStudent', 'annexId2'))
     annexId3 = extFile.getYamlParms(('CStudent', 'annexId3'))
     annexId4 = extFile.getYamlParms(('CStudent', 'annexId4'))
     annexId = [annexId1, annexId2, annexId3, annexId4]
     annexType = [1, 2, 3, 4]
     annexName = ['身份证正面照', '身份证背面照', '学历证书', '相片']
     assert0 = True
     for i in annexId:
         case = TestCaseAssembly().setAipParam(
             'updateAnnex', (i, learnId, annexType[annexId.index(i)],
                             annexName[annexId.index(i)]),
             (('data', 'annexId'), ('data', 'learnId'),
              ('data', 'annexType'), ('data', 'annexName')))
         data0 = {
             'annexFile':
             ('1.jpg',
              open(
                  'C:\\YZeducation\\PyProject\\LYZTest\\test_data\\image\\1.jpg',
                  'rb'), 'image/jpeg'),
             'annexId':
             str(i),
             'annexName':
             annexName[annexId.index(i)],
             'annexType':
             str(annexType[annexId.index(i)]),
             'annexUrl':
             '',
             'isRequire':
             '1',
             'learnId':
             str(learnId)
         }
         data = MultipartEncoder(fields=data0)
         DataSource().setHearder(data.content_type)
         response = YzApi().lapi(
             method=case[0],
             headers=DataSource().getHearder("regiester"),
             urls=case[2],
             data=data)
         assert1 = MyAssert().assertchar(response.text, ['true', '00'])
         assert0 = assert0 and assert1
Ejemplo n.º 20
0
 def test_b_studentChange_findStudentGrade(self):
     '''成教学员随机获取可转报年级'''
     intFile = YamlParser('StudentInfo')
     grade = intFile.getYamlParms(('CJ', 'grade'))
     case = TestCaseAssembly().setAipParam('findStudentGrade', (grade, ),
                                           (('data', 'grade'), ))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数grade列表'''
     gradeList = getJsonParm(response.text, 'body')
     BeforeParamCom().setLearn((('CStudent', 'gradeList'), ),
                               str(gradeList))
Ejemplo n.º 21
0
 def test_C_annexCheck(self):
     '''成教学员附件审核-总审'''
     extFile = YamlParser('LearnInfo')
     intFile = YamlParser('StudentInfo')
     recruitType = intFile.getYamlParms(('CJ', 'recruitType'))
     crId = extFile.getYamlParms(('CStudent', 'crId'))
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     case = TestCaseAssembly().setAipParam(
         'annexCheck', (crId, recruitType, learnId),
         (('data', 'crId'), ('data', 'recruitType'), ('data', 'learnId')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
    def test_a_baseinfo_sUnvs(self):
        '''成教学员新生信息修改申请随机获取新院校id'''
        intFile = YamlParser('StudentInfo')
        recruitType = intFile.getYamlParms(('CJ', 'recruitType'))

        case = TestCaseAssembly().setAipParam('baseinfo_sUnvs',
                                              (recruitType, ),
                                              (('data', 'ext1'), ))
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
        '''提取参数院校idsId'''
        AfterParamCom().saveParam(response.text, 'baseinfo_sUnvs',
                                  ('CStudent', 'sId'))
Ejemplo n.º 23
0
 def test_a_studentChange_edit(self):
     '''成教学员获取转报web_token'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     mobile = extFile.getYamlParms(('CStudent', 'learnId'))
     case = TestCaseAssembly().setAipParam('studentChange_edit',
                                           (learnId, mobile),
                                           (('data', 'learnId'),
                                            ('data', 'mobile')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'studentChange_edit',
                               ('CStudent', '_web_token'))
Ejemplo n.º 24
0
 def test_F_studentScore_edit(self):
     '''成教学员获取入学考试成绩录入web_token'''
     extFile = YamlParser('LearnInfo')
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     idCard = extFile.getYamlParms(('CStudent', 'idCard'))
     case = TestCaseAssembly().setAipParam('studentScore_edit',
                                           (learnId, idCard),
                                           (('data', 'learnId'),
                                            ('data', 'idCard')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     '''断言'''
     self.assertTrue(MyAssert().assertchar(response.text, ['_web_token']),
                     True)
     '''提取参数courses+web_token'''
     AfterParamCom().moreParam(response.text, 'studentScore_edit',
                               (('CStudent', '_web_token'),
                                ('CStudent', 'courses')))
 def test_2_getOpenTestAreaByCity(self):
     '''随机获取国开报读考区ID+考区名称'''
     intFile = YamlParser('StudentInfo')
     extFile = YamlParser('LearnInfo')
     level = intFile.getYamlParms(('GK', 'level'))
     grade = intFile.getYamlParms(('GK', 'grade'))
     city = extFile.getYamlParms(('GStudent', 'city'))
     case = TestCaseAssembly().setAipParam(
         'getOpenTestAreaByCity', (level, grade, city),
         (('data', 'ext2'), ('data', 'ext3'), ('data', 'ext1')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'getOpenTestAreaByCity',
                               (('GStudent', 'taId'),
                                ('GStudent', 'taName')))
    def test_c_testArea_findBdTestAreaNotStop(self):
        '''成教学员新生信息修改申请随机获取新考区id'''
        intFile = YamlParser('StudentInfo')
        extFile = YamlParser('LearnInfo')
        scholarship = intFile.getYamlParms(('CJ', 'scholarships'))
        newPfsnId = extFile.getYamlParms(('CStudent', 'newPfsnId'))

        case = TestCaseAssembly().setAipParam('findBdTestAreaNotStop',
                                              (scholarship, newPfsnId),
                                              (('data', 'scholarship'),
                                               ('data', 'newPfsnId')))
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
        '''提取参数cpfsnId'''
        AfterParamCom().saveParam(response.text, 'findBdTestAreaNotStop',
                                  ('CStudent', 'newTaId'))
    def test_d_studentModify_insertStudentModify(self):
        '''成教学员新生信息修改发起申请'''
        extFile = YamlParser('LearnInfo')
        npfsnLevel = extFile.getYamlParms(('CStudent', 'npfsnLevel'))
        newPfsnId = extFile.getYamlParms(('CStudent', 'newPfsnId'))
        newTaId = extFile.getYamlParms(('CStudent', 'newTaId'))
        newUnvsId = extFile.getYamlParms(('CStudent', 'sId'))
        TxJosn = extFile.getYamlParms(('CStudent', 'TxJosn'))
        case = TestCaseAssembly().setAipParam(
            'insertStudentModify', (npfsnLevel, newPfsnId, newTaId, newUnvsId),
            (('data', 'npfsnLevel'), ('data', 'newPfsnId'),
             ('data', 'newTaId'), ('data', 'newTaId')))

        case[3].update(TxJosn)
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)
Ejemplo n.º 28
0
 def test_D_annexCheckCharge(self):
     '''成教学员附件审核-附件审核'''
     extFile = YamlParser('LearnInfo')
     annexId1 = extFile.getYamlParms(('CStudent', 'annexId1'))
     annexId2 = extFile.getYamlParms(('CStudent', 'annexId2'))
     annexId3 = extFile.getYamlParms(('CStudent', 'annexId3'))
     annexId4 = extFile.getYamlParms(('CStudent', 'annexId4'))
     learnId = extFile.getYamlParms(('CStudent', 'learnId'))
     annexId = [annexId1, annexId2, annexId3, annexId4]
     assert0 = True
     for i in annexId:
         case = TestCaseAssembly().setAipParam('annexCheckCharge',
                                               (i, learnId),
                                               (('data', 'annexId'),
                                                ('data', 'learnId')))
         response = YzApi().lapi(method=case[0],
                                 headers=case[1],
                                 urls=case[2],
                                 data=case[3])
         assert1 = MyAssert().assertchar(response.text, ['true', '00'])
         assert0 = assert0 and assert1
 def test_3_getOpenPfsnByTaId(self):
     '''随机获取国开报读专业pfsnId+专业名称pfsnName+专业编号pfsnCode'''
     intFile = YamlParser('StudentInfo')
     extFile = YamlParser('LearnInfo')
     case = TestCaseAssembly().setAipParam(
         'getOpenPfsnByTaId', (intFile.getYamlParms(
             ('GK', 'level')), intFile.getYamlParms(
                 ('GK', 'grade')), extFile.getYamlParms(
                     ('GStudent', 'taId'))),
         (('data', 'ext2'), ('data', 'ext3'), ('data', 'ext1')))
     response = YzApi().lapi(method=case[0],
                             headers=case[1],
                             urls=case[2],
                             data=case[3])
     self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                     True)
     '''提取参数'''
     AfterParamCom().saveParam(response.text, 'getOpenPfsnByTaId',
                               (('GStudent', 'pfsnId'),
                                ('GStudent', 'pfsnName'),
                                ('GStudent', 'pfsnCode')))
Ejemplo n.º 30
0
    def test_J_stdEnroll_enroll(self):
        '''成教学员录取'''
        extFile = YamlParser('LearnInfo')
        intFile = YamlParser('StudentInfo')
        level = intFile.getYamlParms(('CJ', 'level'))
        learnId = extFile.getYamlParms(('CStudent', 'learnId'))
        grade = intFile.getYamlParms(('CJ', 'grade'))
        pfsnId = extFile.getYamlParms(('CStudent', 'pfsnId'))
        unvsId = extFile.getYamlParms(('CStudent', 'unvsId'))

        case = TestCaseAssembly().setAipParam(
            'stdEnroll', (learnId, level, grade, pfsnId, unvsId),
            (('data', 'learnId'), ('data', 'level'), ('data', 'grade'),
             ('data', 'pfsnId'), ('data', 'unvsId')))
        response = YzApi().lapi(method=case[0],
                                headers=case[1],
                                urls=case[2],
                                data=case[3])
        '''断言'''
        self.assertTrue(MyAssert().assertchar(response.text, ['true', '00']),
                        True)