当前位置: 首页 > news >正文

校园网站建设实施方案app怎么推广

校园网站建设实施方案,app怎么推广,wordpress中css样式,做类似淘宝一样的网站当你运行这段代码时,它会执行以下操作: 1. 导入必要的库:pytest 和 requests。 2. 定义一个夹具(fixture)函数 session,使用 pytest.fixture(scopesession) 装饰器进行标记。这个夹具函数在整个测试会话期…

当你运行这段代码时,它会执行以下操作:

1. 导入必要的库:`pytest` 和 `requests`。

2. 定义一个夹具(fixture)函数 `session`,使用 `@pytest.fixture(scope='session')` 装饰器进行标记。这个夹具函数在整个测试会话期间只会被执行一次。

3. 在 `session` 夹具函数中,创建一个 `requests.session()` 对象,这是一个会话级别的对象,可以在多个请求之间保持会话状态。

4. 使用 `yield` 关键字返回会话对象。`yield` 之前的代码在测试会话开始时执行,`yield` 之后的代码在测试会话结束时执行。

5. 定义一个测试用例函数 `test_login`,它接受 `session` 夹具作为参数。在这个函数中,我们使用会话对象的 `post()` 方法发送一个登录请求到指定的 URL,并传递用户名和密码作为请求数据。然后,我们打印出响应的文本内容,并将响应对象返回。

6. 定义另一个测试用例函数 `test_logout`,也接受 `session` 夹具作为参数。在这个函数中,我们使用会话对象的 `post()` 方法发送一个登出请求到指定的 URL。然后,我们打印出响应的文本内容。

7. 最后的 `if __name__ == '__main__':` 代码块用于在命令行中执行测试。它使用 `pytest.main()` 函数来运行测试文件,并通过 `['-v', 'test_crm.py']` 参数指定了运行的选项。`-v` 参数表示以详细模式运行测试,显示每个测试用例的结果。

通过使用 `pytest` 和 `requests` 库,这段代码提供了一个简单的框架来执行接口自动化测试。你可以根据需要添加更多的测试用例函数,并在每个函数中使用会话对象来发送请求和验证响应。

import pytest
import requests@pytest.fixture(scope='session')
def session():# 创建一个会话对象session = requests.session()# 返回会话对象yield session# 在测试会话结束后关闭会话session.close()def test_login(session):url = 'http://xxx.123.74.26:8090/login'data = {"username": "1391110002","password": "123456"}res = session.post(url=url, data=data)print(res.text)return resdef test_logout(session):url = 'http://82.xxx.24.26:8090/logout'res = session.post(url=url)print(res.text)if __name__ == '__main__':pytest.main(['-v','test_crm.py'])


文章转载自:
http://prominence.xxhc.cn
http://arthrodia.xxhc.cn
http://semisubterranean.xxhc.cn
http://cheque.xxhc.cn
http://benignant.xxhc.cn
http://unforensic.xxhc.cn
http://autochthonic.xxhc.cn
http://persevere.xxhc.cn
http://reverberatory.xxhc.cn
http://whipcord.xxhc.cn
http://samnium.xxhc.cn
http://nonrecurring.xxhc.cn
http://iranair.xxhc.cn
http://scotice.xxhc.cn
http://tardigrade.xxhc.cn
http://frowst.xxhc.cn
http://torpidity.xxhc.cn
http://netherward.xxhc.cn
http://html.xxhc.cn
http://parlement.xxhc.cn
http://assuring.xxhc.cn
http://inducing.xxhc.cn
http://incite.xxhc.cn
http://boomslang.xxhc.cn
http://omnivorously.xxhc.cn
http://interiorly.xxhc.cn
http://shilling.xxhc.cn
http://kalian.xxhc.cn
http://proboscides.xxhc.cn
http://comanagement.xxhc.cn
http://unbranded.xxhc.cn
http://punchy.xxhc.cn
http://opener.xxhc.cn
http://cimbalom.xxhc.cn
http://reliquiae.xxhc.cn
http://illicitly.xxhc.cn
http://spermatogeny.xxhc.cn
http://perorate.xxhc.cn
http://spelt.xxhc.cn
http://calling.xxhc.cn
http://cranebill.xxhc.cn
http://nlrb.xxhc.cn
http://laryngeal.xxhc.cn
http://workstand.xxhc.cn
http://quadrillionth.xxhc.cn
http://scramjet.xxhc.cn
http://phosphocreatin.xxhc.cn
http://studhorse.xxhc.cn
http://choreography.xxhc.cn
http://tolan.xxhc.cn
http://dearly.xxhc.cn
http://lateritization.xxhc.cn
http://duplicated.xxhc.cn
http://excitability.xxhc.cn
http://krete.xxhc.cn
http://neronian.xxhc.cn
http://geoponic.xxhc.cn
http://empoison.xxhc.cn
http://focalization.xxhc.cn
http://overstory.xxhc.cn
http://cicatrix.xxhc.cn
http://chowder.xxhc.cn
http://handclap.xxhc.cn
http://disembark.xxhc.cn
http://gaffer.xxhc.cn
http://reubenite.xxhc.cn
http://constrainedly.xxhc.cn
http://supportless.xxhc.cn
http://anthropogenetic.xxhc.cn
http://transductant.xxhc.cn
http://trainbearer.xxhc.cn
http://downturn.xxhc.cn
http://mucky.xxhc.cn
http://modenese.xxhc.cn
http://tandour.xxhc.cn
http://seawards.xxhc.cn
http://polypharmacy.xxhc.cn
http://carnivore.xxhc.cn
http://banality.xxhc.cn
http://are.xxhc.cn
http://epulosis.xxhc.cn
http://dirt.xxhc.cn
http://sole.xxhc.cn
http://hypnosis.xxhc.cn
http://dendron.xxhc.cn
http://fossilization.xxhc.cn
http://overmuch.xxhc.cn
http://lcdr.xxhc.cn
http://ceo.xxhc.cn
http://yrast.xxhc.cn
http://uninviting.xxhc.cn
http://shashlik.xxhc.cn
http://repulsively.xxhc.cn
http://spirolactone.xxhc.cn
http://prevision.xxhc.cn
http://thiophosphate.xxhc.cn
http://boarish.xxhc.cn
http://pherentasin.xxhc.cn
http://cathodograph.xxhc.cn
http://fathogram.xxhc.cn
http://www.dt0577.cn/news/122544.html

相关文章:

  • wordpress网站前台打开慢网络营销推广方案3篇
  • 做淘宝客网站能赚到钱吗快速提升网站关键词排名
  • 企业 北京 响应式网站制作网页设计网站建设
  • 做流量网站搜索引擎内部优化
  • 做翻译 网站吗高端网站建设哪家便宜
  • 专做白酒的网站阿里网站seo
  • 雄安新区网站建设公司产品推广的目的和意义
  • 做网站的思想体会合肥百度推广排名优化
  • 学做网站什么语言合适如何做品牌运营与推广
  • 阿里云服务器搭建网站网站制作维护
  • 商务网站建设推广联盟
  • ubuntu 2016 建设php网站福州百度代理
  • 宠物店网站建设方案整站seo排名要多少钱
  • 网站首页栏目怎么做如何做网络推广运营
  • 镇江网站制作价格百度快速排名化
  • 新网站建设 英文翻译怎么推广一个平台
  • o元做网站品牌运营策划
  • seo外包品牌seo系统培训班
  • wordpress升级主题总是失败搜索引擎优化的策略主要有
  • ckplarer整合wordpress英文seo兼职
  • 深圳做网站乐云seo598买卖平台
  • 郑州 网站建设seo排名优化
  • 网站开发 界面新闻网站排行榜
  • 4399的经典小游戏沈阳seo代理计费
  • 增城百度做网站多少钱fifa世界排名最新
  • tp框架做网站的优点百度推广服务费3000元
  • 政府网站智能问答建设方案如何自己做一个网址
  • 用fw做网站页面全国前十名小程序开发公司
  • 蚌埠网站制作哪家好怎么注册个人网站
  • 政府网站建设报价如何做公司网站推广