Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
tep是Try Easy Pytest的首字母缩写,帮你轻松上手pytest。
框架特点:
支持Python3.8以上版本
创建虚拟环境:python -m venv .venv
激活虚拟环境,Windows用户:activate.bat
Mac用户:source .venv/bin/activate
安装tep:pip install tep
验证安装成功:tep -V
用例示范:
import json
from tep import request
from tep import step
from tep import v
from data.global_data import GlobalData
def test():
v({
"domain": GlobalData.domain,
"skuNum": 2,
"payAmount": 0.2
})
step("查询商品", step_search_sku)
step("添加购物车", step_add_cart)
step("下单", step_order)
step("支付", step_pay)
def step_search_sku():
url = v("${domain}/searchSku?skuName=book")
response = request("get", url=url, headers=GlobalData.headers)
assert response.status_code < 400
v("skuId", response.jsonpath("$.skuId")[0])
v("skuPrice", response.jsonpath("$.price")[0])
def step_add_cart():
url = v("${domain}/addCart")
body = """
{
"skuId": "${skuId}",
"skuNum":${skuNum}
}
"""
response = request("post", url=url, headers=GlobalData.headers, json=json.loads(v(body)))
assert response.status_code < 400
v("skuNum", response.jsonpath("$.skuNum")[0])
v("totalPrice", response.jsonpath("$.totalPrice")[0])
def step_order():
url = v("${domain}/order")
body = """
{
"skuId": "${skuId}",
"price":${skuPrice},
"skuNum":${skuNum},
"totalPrice":${totalPrice}
}
"""
response = request("post", url=url, headers=GlobalData.headers, json=json.loads(v(body)))
assert response.status_code < 400
v("orderId", response.jsonpath("$.orderId")[0])
def step_pay():
url = v("${domain}/pay")
body = """
{
"orderId": "${orderId}",
"payAmount":${payAmount}
}
"""
response = request("post", url=url, headers=GlobalData.headers, json=json.loads(v(body)))
assert response.status_code < 400
assert response.jsonpath("$.success")[0] == "true"
FAQs
tep is a testing framework to help you write pytest more easily. Try Easy Pytest!
We found that tep demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.