Skip to main content

Lan(懒)是一套测试框架 .

Project description

Lan(懒)是一套测试框架 .

主要功能

接口测试(Interface Testing) 简称 it 服务器监控(Server monitoring) 简称 sm

安装

第一种

pip install lan

第二种 使用时可以直接下载源码来执行

python setup.py install

使用方法

1、创建Project(自定义)文件夹,进入目录

cd Project

2、执行

lan

后显示

usage: lan [-h] {create,make,run,server} ...
Lan(懒)是一套Python测试套件脚手架
positional arguments:
  {create,make,run,server}
    create              - 创建项目 项目类型(it st sm)/项目名称
    make                - 用例生成 根据config.yaml文件生成用例文件
    run                 - 运行项目 结束退出
    server              - 运行项目 后台模式

3、选择需要创建的类型 创建接口测试(项目名称必填):

lan create it/projectName

创建压测(项目名称必填):

lan create st/projectName

创建服务器监控(项目名称必填):

lan create sm/projectName

3、运行

python run.py

方法调用说明

# 需要模块哪些就引入哪些
from lan import Utils,Request,FileDb,Config,Log,Monitor
Utils 工具类
# 获取年月日
Utils.time_ymd()
# 返回:20190520
# 判断是否为空
Utils.empty(val)
# 返回:True/False
# 创建目录
Utils.mkdir(path)
# 返回:True/False
# 读取文件
Utils.open_file(path)
# 返回:content
# 写入文件
Utils.write_file(path, content)
# 删除文件
Utils.remove_file(path)
Request 请求类
# Get请求
Request.get(api,data,headers,stream)
# Post请求
Request.post(api,data,headers,stream)
# Put请求
Request.put(api,data,headers,stream)
# Delete请求
Request.delete(api,headers,stream)

统一返回

{
	'status_code': 200,
	'status': 'success', # success/error
	'response': {},
	'time': 0,  # 时间
	'msg': ''  # 错误提示
}

学习怎么开发框架

开始学习

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lan.io-0.0.2.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lan.io-0.0.2-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file lan.io-0.0.2.tar.gz.

File metadata

  • Download URL: lan.io-0.0.2.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for lan.io-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38ebc792159893de2f68c3449103caae6ccb7bdc3b7ca6e38f93a4f28aff4515
MD5 f9af74a46e37dc9885ed8416c556619b
BLAKE2b-256 26a62a53a7ff46a1ad4bfbc671a5192462c84c73e659847c5013d5c4918cf44f

See more details on using hashes here.

File details

Details for the file lan.io-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: lan.io-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for lan.io-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0602b2dc2fdac7aadc0e5c9a4768f6339c52a15b6f48ad9790e6e62f5ac0661
MD5 6450b2607423a65e30df0312dfbd7657
BLAKE2b-256 acc6ad54889ee06f4fde1e53be19fca7b94b836f1ed4b320a5244ba382b41153

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page