埃皮亚杰
ejpiaj的Python项目详细描述
许可证
- 自由软件:BSD许可证
功能
- describe your API requests in single file (YAML, JSON and XML at this moment) so you can store you API tests with code in same repository (f.i. as ejpiaj.json file)
- file format is detected from file extension ^{tt1}$, ^{tt2}$ and ^{tt3}$
- extract variables from responses and store them to use in next requests (f.i. to get and use authorization token)
- write assertions agains responses
- register your own variables extractors and assertions
- run suite using ^{tt4}$ command
示例YML文件:
requests: 001_search_repos_with_django_in_name: method: get url: https://api.github.com/search/repositories url_params: q: django sort: stars order: desc variables: json: total_count: count items.[0].full_name: repo_name assertions: response: - 'status_code equals 200' json: - 'items.[0].full_name contains ango' 002_get_commits_from_first_repo: method: get url: https://api.github.com/repos/{{repo_name}}/commits assertions: response: - 'status_code equals 200'
运行它:
$ ejpiaj-cli test sample.yml -s -------------------------------------------------------------------------------- P - passed assertions, F - failed assertions, V - extracted variables -------------------------------------------------------------------------------- ✓ 001_search_repos_with_django_in_name [P2,F0,V2] {'count': 29754, 'repo_name': u'django/django'} ✓ 002_get_commits_from_first_repo [P1,F0,V0] {} --------------------------------------------------------------------------------
SNI注释
为了支持python 2.6/2.7中的SNI,您需要安装其他软件包:
- pyopenssl,一个围绕openssl库的python包装模块。
- ndg httpsclient,增强了对httplib和urllib2的HTTPS支持
- pyasn1,asn.1类型和编解码器。
历史记录
0.4.4(2015-01-21)
- 修复了读取str/int参数时的unicode错误
0.4.3(2014-09-10)
- 修复了与Python3.3的兼容性
0.4.2(2014-09-10)
- 修正了变量替换时的上下文替换
0.4.1(2014-09-10)
- 固定的非unicode提取变量
0.4.0(2014-03-11)
- 增加了对xml和json文件的支持
0.3.3(2014-03-06)
- 将-e/-env选项添加到ejpiaj-cli以传递初始变量
- 将-q/-quiet选项添加到ejpiaj-cli的quiet输出
0.3.2(2014-02-17)
- 将-s选项添加到ejpiaj-cli以显示提取的变量
0.3.1(2014-02-17)
- 修复了从当前目录加载自定义模块的问题
0.3.0(2014-02-16)
- 添加了对使用自定义断言和变量提取器加载自己模块的支持 使用ejpiaj-cli工具
0.2.3(2014-02-10)
- 固定测试顺序(按字母顺序)
0.2.2(2014-02-10)
- 多变量的固定变量替换
- 在“url”中添加了变量替换
0.2.1(2014-02-07)
- 变量为“无”时的固定变量替换
0.2.0(2014-02-07)
- 增加了对表单参数和标题的支持
0.1.0(2014-02-01)
- pypi上的第一个版本。