Beispiel #1
0
    def testCase(self):
        """
        test body
        :return:
        """
        # set url
        self.url = url.users_profile
        configHttp.set_url(self.url)

        # set headers
        configHttp.set_headers()

        # set params
        params = {"username": self.username}
        configHttp.set_params(params)

        # set date
        data = json.dumps({
            "mobilePhoneNumber": self.mobilePhoneNumber,
            "password": self.password,
            "reaCode": self.areaCode
        })
        configHttp.set_data(data)

        # test interface
        self.response = configHttp.get()

        # check result
        self.checkResult()
    def testGetCity(self):
        """
        test body
        :return:
        """
        print("开始执行第一个用例==============>>>>>>>>>")
        # get url
        self.url = common.get_url_from_xml('getCityList')
        configHttp.set_url(self.url)
        print("第一步:设置url  " + self.url)

        # get visitor token
        if self.token == '1':
            token = localReadConfig.get_headers("token_v")
        elif self.token == '0':
            token = None

        # set headers
        header = {"authorization": str(token)}
        configHttp.set_headers(header)
        print("第二步:设置header(token等)")

        # set params
        params = {"type": self.type}
        configHttp.set_params(params)
        print("第二步:设置发送请求的参数", self.type)

        # test interface
        print("第三步:发送请求请求方法:")
        self.return_json = configHttp.get()

        # check result
        print("第四步:检查结果")
        self.checkResult()
    def testGetDisease(self):
        """
        test body
        :return:
        """
        print("开始执行第一个用例==============>>>>>>>>>")
        # get url
        self.url = common.get_url_from_xml('getDiseasesList')
        configHttp.set_url(self.url)
        print("第一步:设置url  " + self.url)

        # get visitor token
        if self.token == '1':
            token = localReadConfig.get_headers("token_v")
        elif self.token == '0':
            token = None

        # set headers
        header = {"authorization": str(token)}
        configHttp.set_headers(header)
        print("第二步:设置header(token等)")

        # set params
        params = {
            "isCommon": self.isCommon,
            "name": self.name,
            "parentCategoryId": self.parentCategoryId,
            "categoryId": self.categoryId,
            "relatedDoctor": self.relatedDoctor,
            "page": self.page,
            "pageSize": self.pageSize
        }
        configHttp.set_params(params)
        print("第二步:设置发送请求的参数", params)

        # test interface
        print("第三步:发送请求请求方法:")
        self.return_json = configHttp.get()

        # check result
        print("第四步:检查结果")
        self.checkResult()
    def testUsersProfile(self):
        """
        test body
        :return:
        """
        # set url
        self.url = url.users_profile
        configHttp.set_url(self.url)

        # set headers
        configHttp.set_headers()

        # set params
        params = {"username": self.username}
        configHttp.set_params(params)

        # test interface
        self.response = configHttp.get()

        # check result
        self.checkResult()
Beispiel #5
0
    def testFlow(self):
        self.url = common.get_url_from_xml('flow')

        # set url
        configHttp.set_url(self.url)

        # set headers
        configHttp.set_headers()

        # set params
        params = {
            'coin_type': self.coin_type,
            'page': self.page,
            'page_size': self.page_size
        }
        configHttp.set_params(params)

        # test interface
        self.return_json = configHttp.request_get()

        self.checkResult()
Beispiel #6
0
    def testTopicsGetDetail(self):
        """
        test body
        :return:
        """
        # set url
        self.url = url.topics_getDetail
        configHttp.set_url(self.url)

        # set headers
        getHeaders.login_refresh_token()
        configHttp.set_headers()

        # set params
        params = {"id": self.topics_id, "ref": self.ref}
        configHttp.set_params(params)

        # test interface
        self.response = configHttp.get()

        # check result
        self.checkResult()
Beispiel #7
0
    def testDetail(self):
        '''
        查询某笔交易详情
        :return:
        '''
        self.url = common.get_url_from_xml('detail')

        # set url
        configHttp.set_url(self.url)

        # set headers
        configHttp.set_headers()

        # set params
        params = {'tx_id':self.tx_id,
                 'coin_type':self.coin_type}
        configHttp.set_params(params)

        # test interface
        self.return_json = configHttp.request_get()

        self.checkResult()