예제 #1
0
        #     Logger.error("enable user, expected code is 10000002")
        #     Logger.error(str(response.json()))
        # app_id不合法
        response = u_status.enable_user(uid_1, uid_2, token_1, app_id_err)
        if response.json()["code"] != "10000003":
            Logger.error("enable user, expected code is 10000003")
            Logger.error(str(response.json()))
        # 解禁成功
        response = u_status.enable_user(uid_1, uid_2, token_1, app_id_1)
        if str(response.json()["result"]) != "True":
            Logger.error("enable user, expected result is \"True\"")
            Logger.error(str(response.json()))
        # 解禁成功后,能正常登陆
        response = a_auth.login(user_code_2, password, app_id_1)
        if response.json()["uid"] != uid_2:
            Logger.error("enable user, fail to login")
            Logger.error(str(response.json()))


if __name__ == "__main__":
    db = MongoProcess("uiac", "127.0.0.1", 27017)
    db.clear()
    db.init()

    cache = Cache("http://127.0.0.1:8081")
    cache.clean()

    Logger.init()
    admin = AccountAdmin(CONST.SERVICE_URL)
    admin.run()
예제 #2
0
파일: main.py 프로젝트: mendylee/uiso
 def __init__(self, base_url, db_name="uiac"):
     self.baseUrl = base_url
     self.db_name = db_name
     Logger.init()