def test02_app_find(self): # 调用查询接口 r = self.app.api_app_find() try: # 断言 Tool.common_assert(r, status_code=200) except Exception as e: log.error(e)
def test03_mis_audit(self): # 调用登录接口 r = self.mis.api_mis_audit() try: # 断言 Tool.common_assert(r) except Exception as e: log.error() raise
def test02_app_article(self): # 调用查询接口 r = self.app.api_app_article() try: # 断言 Tool.common_assert(r, status_code=200) except Exception as e: # 日志 log.error(e) # 抛异常 raise
def test03_mis_audit(self): # 1. 调用审核接口 r = self.mis.api_mis_audit() try: # 2. 断言 Tool.common_assert(r) except Exception as e: # 日志 log.error(e) # 抛异常 raise
def test02_mis_find(self): # 1. 调用查询接口 r = self.mis.api_mis_find() try: # 2. 断言 200:为int 不能加引号 Tool.common_assert(r, status_code=200) except Exception as e: # 日志 log.error(e) # 抛异常 raise
def test01_app_login(self, phone=api.phone, code=api.code): # 调用登录接口 r = self.app.api_app_login(phone, code) try: # 提取token Tool.common_token(r) # 断言 Tool.common_assert(r) except Exception as e: log.error(e) raise
def test01_mis_login(self, user=api.mis_user, pwd=api.mis_pwd): # 调用登录接口 r = self.mis.api_mis_login(user, pwd) try: # 提取token Tool.common_token(r) # 断言 Tool.common_assert(r) except Exception as e: log.error(e) raise
def test01_app_login(self, mobile=api.mobile, code=api.code): # 1. 调用登录接口 r = self.app.api_app_login(mobile, code) try: # 2. 提取token Tool.common_token(r) # 3. 断言 Tool.common_assert(r) except Exception as e: # 日志 log.error(e) # 抛异常 raise
def test01_mis_login(self, account="testid", password="******"): # 1. 调用登录接口 r = self.mis.api_mis_login(account, password) try: # 2. 提取token Tool.common_token(r) # 3. 断言 Tool.common_assert(r) except Exception as e: # 日志 log.error(e) # 抛异常 raise
def test01_mp_login(self, mobile, code): # 调用登录接口 r = self.mp.api_mp_login(mobile, code) try: # 提取token Tool.common_token(r) # 断言 Tool.common_assert(r) except Exception as e: # 1. 日志 log.error(e) # 2. 抛异常 raise
def test02_mp_article(self, title=api.title, content=api.content): # 调用发布文章接口 r = self.mp.api_mp_article(title, content) try: # 提取文章id api.article_id = r.json().get("data").get("id") log.info("正在提取发布文章id:{}".format(api.article_id)) # 断言 Tool.common_assert(r) except Exception as e: # 1. 日志 log.error(e) # 2. 抛异常 raise