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

Doublex-Expects is a matchers library for the Expects assertion library. It provides matchers for the Doublex test double library.

Usage

Just import the expect callable and the Doublex-Expects matchers and start writing assertions for test doubles.

Spies

from expects import expect
from doublex_expects import *
from doublex import Spy

my_spy = Spy()

my_spy.method()

expect(my_spy.method).to(have_been_called)

Mocks

from expects import expect
from doublex_expects import *
from doublex import Mock

with Mock() as my_mock:
    my_mock.reset()
    my_mock.add(1)

my_mock.reset()
my_mock.add(1)

expect(my_mock).to(have_been_satisfied)

Matchers

have_been_called

Asserts that a spy has been called.

expect(my_spy.method).to(have_been_called)
expect(my_spy.method).not_to(have_been_called)

have_been_called_with

Asserts that a spy has been called with given arguments.

expect(my_spy.method).to(have_been_called_with('foo', key='bar'))
expect(my_spy.method).to(have_been_called_with(a(str), key=match('\w+')))
expect(my_spy.method).to(have_been_called_with(anything, key='bar'))
expect(my_spy.method).to(have_been_called_with('foo', any_arg))
expect(my_spy.method).not_to(have_been_called_with('bar', key='foo'))

Times called modifiers

once

Asserts that a spy has been called exactly once.

expect(my_spy.method).to(have_been_called.once)
expect(my_spy.method).to(have_been_called_with('foo').once)
expect(my_spy.method).not_to(have_been_called.once)

twice

Asserts that a spy has been called exactly twice.

expect(my_spy.method).to(have_been_called.twice)
expect(my_spy.method).to(have_been_called_with('foo').twice)
expect(my_spy.method).not_to(have_been_called.twice)

exactly

Asserts that a spy has been called exactly n times.

expect(my_spy.method).to(have_been_called.exactly(3))
expect(my_spy.method).to(have_been_called_with('foo').exactly(3))
expect(my_spy.method).not_to(have_been_called.exactly(3))

max

Asserts that a spy has been called maximum of n times.

expect(my_spy.method).to(have_been_called.max(2))
expect(my_spy.method).to(have_been_called_with('foo').max(2))
expect(my_spy.method).not_to(have_been_called.max(2))

min

Asserts that a spy has been called minimum of n times.

expect(my_spy.method).to(have_been_called.min(2))
expect(my_spy.method).to(have_been_called_with('foo').min(2))
expect(my_spy.method).not_to(have_been_called.min(2))

have_been_satisfied

Verifies that a mock calls have been satisfied.

expect(my_mock).to(have_been_satisfied)
expect(my_mock).not_to(have_been_satisfied)

have_been_satisfied_in_any_order

Verifies that a mock calls have been satisfied regardless of the execution order.

expect(my_mock).to(have_been_satisfied_in_any_order)
expect(my_mock).not_to(have_been_satisfied_in_any_order)

Installation

You can install the last stable release from PyPI using pip or easy_install.

$ pip install doublex-expects

Also you can install the latest sources from Github.

$ pip install -e git+git://github.com/jaimegildesagredo/doublex-expects.git#egg=doublex-expects

Specs

To run the specs you should install the testing requirements and then run mamba.

$ python setup.py develop
$ pip install -r test-requirements.txt
$ mamba
Release History

Release History

0.7.0rc2

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.7.0rc1

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.6.0

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.5.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

0.4.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

0.3.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

0.2.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

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
doublex-expects-0.6.0.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Jun 25, 2015

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