This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

BDD-style Rest API testing tool

It uses python’s requests for performing HTTP requests, nose for most assertions, trafaret for json validation and behave for BDD style of tests.

Installation

Clone project

Run

pip install -r requirements.txt # install required dependencies

OR

Run

pip install behave_rest

Running

# to execute all feature files (all tests)
behave

# to execture specific feature
behave features/twitter.feature

# to see printed output add --no-capture
behave --no-capture

# run features with specific tags
behave --tags=without_login --tags=slow

More about behave tool you can read here https://pythonhosted.org/behave/index.html

Test example

Feature: Twitter search

  Background: Setup environment
    Given I set base URL to "https://api.twitter.com/1.1/search"
    And I set "Authorization" header to "context.twitter_auth"

  Scenario: Search for tweets
    When I make a GET request to "tweets.json" with parameters
    |q|
    |stanfy|
    Then the response status code should equal 200
    And the response structure should equal "twitterSearchData"
    And the response header "status" should equal "200 OK"

You can get test feature files from the project repo

CI reports

Behave support JUnit reports, that are easily parsed by CI tools

To enable JUnit reports, create behave.ini file:

[behave]
junit=true

Reports are generated into /reports folder

Another useful options to add into behave.ini are:

stdout_capture=False to add printed output into reports

show_timings=no to hide timing of each step

Project Structure

Feature files are intended to locate in /features folder

Corresponding steps are located in /features/steps

Overall project structure is as follows:

+-- features/

    +-- conf.yaml // store project config (urls, global variables, etc.)

    +-- environment.py // context setup steps (e.g. load from config)

    +-- *.feature // feature files

    +-- steps/

        +-- __init__.py // used to import predefined steps

        +-- json_responses.py // response structures described in Trafaret format

        +-- *.py // steps related to corresponding feature (e.g. "login.py" contains steps that are related to "login.feature")
Release History

Release History

0.1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
behave-rest-0.1.3.tar.gz (5.1 kB) Copy SHA256 Checksum SHA256 Source Oct 18, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting