Git Product home page Git Product logo

zerotest's Introduction

ZEROTEST PyPI Travis

Zerotest makes it easy to test API server, start a micro proxy, send requests, and generate test code by these behaviours.

Install

Stable version: pip install zerotest

Develop version: pip install git+https://github.com/jjyr/zerotest.git

zerotest require python2.7 or 3.3+

Quick Start

  1. Start a local proxy to capture http traffic zerotest server https://api.github.com -f octocat.data

  2. Make few requests curl -i http://localhost:7000/users/octocat

  3. Press C-c to exit local proxy

  4. Generate test code zerotest generate octocat.data --ignore-all-headers > test_octocat.py

  5. Type py.test test_octocat.py to run test

Usage

Type zerotest -h to see help message

Server

Start local proxy server

zerotest server http://target-endpoint.com [-f] [record_file.data]

Type zerotest server -h to see help message

Generate

Generate python test code from record data (the file generated by local proxy)

zerotest generate [options] > test_file.py

Ignore specific headers in comparison

Use option --ignore-headers [date server ...] or --ignore-all-headers to ignore headers comparison

Ignore specific fields

Use --fuzzy-match enable fuzzy matching mode, compare data schema instead the data itself, or you can use --ignore-fields [view_count ...] to specific ignored fields

Type zerotest generate -h to see help message

Replay

Generate test and run it with pytest

zerotest replay [generate options] [--pytest] [pytest options]

Type zerotest replay -h to see help message

Develop

Export debug flag ZEROTEST_DEBUG=true to see verbose logs during program or test running.

Contributors

Contributors

Contribute

  • Open issue if found bugs or some cool ideas
  • Feel free to ask if have any questions
  • Testing is very important for a test tool, commit your test file together with pull request

zerotest's People

Contributors

jjyr avatar targaryen avatar tktech avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.