import pymongo
from xml.sax.saxutils import escape
from bson.objectid import ObjectId
import time, datetime
import os
import sys
o_path = os.getcwd()  #返回当前工作目录
sys.path.append(o_path)  #添加自己指定的搜索路径
from utils import jsonRead
from utils import readYaml
from utils import readConfig

import sys

#获取config.yaml文件中数据库配置数据
commonConfig = readYaml.get_config("common/config.yaml", "dbInfo")
dbIP = commonConfig[1]["mongodbIp"]
dbPort = commonConfig[1]["mongodbPort"]
dbUser = commonConfig[1]["mongodbUser"]
dbPsw = commonConfig[1]["mongodbPsw"]

print(dbIP, dbPort, dbUser, dbPsw)


class Stack:
    def __init__(self):
        self.items = []

    def isEmpty(self):
        return len(self.items) == 0
Exemple #2
0
import json
import requests
import yaml
from jsonpath_rw import jsonpath, parse
from utils import readYaml
from utils import jsonRead
from utils import jsonAnalysis
from utils import mongoDataOpr
from utils import httpApi

testerName = 'sunxiaojian'
controllerName = "RedirectPoliciesController"
interfaceChName = "Web重定向策略管理"
interfaceEnName = "addwebRedirectPolicies"

commonConfig = readYaml.get_config("common/config.yaml",
                                   "common")  # 返回config.yaml文件中的common数组的所有数据
authenticationApiPaths = readYaml.get_apiPath(
    "common/apiPaths/authenticationPath.yaml"
)  # 返回linkidPath.yaml文件中的所有linkid接口路径
urlIP = commonConfig[0]["linkidIP"]
urlPath = authenticationApiPaths[0]['addwebRedirectPolicies']

dirPath, fileName = os.path.split(os.path.abspath(__file__))
cases_main, parameters_main = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                    'mainCaseData')  # 读取测试数据
cases_all, parameters_all = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                  'allCaseData')
dbJsonPath = dirPath + "/dbData.json"
dbName = "authentication"

Exemple #3
0
from jsonpath_rw import jsonpath, parse
from utils import readConfig
from utils import readYaml
from utils import jsonRead
from utils import zt_linkidApi
from utils import jsonAnalysis
from utils import mongoDataOpr
from utils import httpApi
from utils import checkConnect

testerName = 'yangxi'
controllerName = "ztApiOrganizationController"
interfaceChName = "批量查询组织"
interfaceEnName = "batchGetOrg"

commonConfig = readYaml.get_config("common/config.yaml", "common")
linkidApiPaths = readYaml.get_apiPath("common/apiPaths/linkidPath.yaml")
ssoApiPaths = readYaml.get_apiPath("common/apiPaths/ssoPath.yaml")
tokenJ = zt_linkidApi.accessToken(commonConfig[0]['sid'],
                                  ssoApiPaths[0]['tokenPath'],
                                  commonConfig[0]['appId'],
                                  commonConfig[0]['appSecret'])
urlIP = commonConfig[0]["sidself"]
urlPath = linkidApiPaths[0]['publicZtOrgGetPath']

dirPath, fileName = os.path.split(os.path.abspath(__file__))
cases_main, parameters_main = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                    'mainCaseData')
cases_all, parameters_all = jsonRead.loadHttpData(dirPath + "/testData.json",
                                                  'allCaseData')
dbJsonPath = dirPath + "/dbData.json"