埃皮亚杰

ejpiaj的Python项目详细描述


https://badge.fury.io/py/ejpiaj.pnghttps://travis-ci.org/onjin/ejpiaj.png?branch=masterhttps://pypip.in/d/ejpiaj/badge.pnghttps://pypip.in/license/ejpiaj/badge.png

许可证

  • 自由软件: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上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将字符串转换为自定义对象   java如何从socket方法获取数据?   Java中的soap读取回车和新行   java在单击时替换图像   java推荐的使用RXJava执行异步任务的方法   java MySql连接器JDBC驱动程序不支持连接池吗?   java将活动堆栈清理到顶部   java计数用户输入的数量   java从webservice下载大文件导致应用程序性能问题   JavaLocalDate。EPOCH不可用   java如何在使用Selenium等待一定时间后,在页面无法加载(get(url))时自动刷新页面   java Calendar setLenient方法不允许检查年份字段的健全性   java Eclipse和intelliJ 安卓 SDK问题   java为什么我可以在没有super关键字的情况下调用父方法?   java iText的PDF格式不好