Skip to main content

Python mocks made for humans

Project description

Prophepy

Python mocks made for humans. Heavily inspired by the great PHP's Prophecy.

Usage

from examples.calculator import Calculator
from examples.displayer import Displayer
from prophepy import prophesize

calculator = prophesize(Calculator)
displayer = Displayer(calculator._reveal())

calculator.add(2, 3)._should_be_called()
calculator.add(2, 3)._will_return(5)
displayer.display_add(2, 3)

calculator.check_prophecies()

Tests

python -m unittest tests/test.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prophepy-0.0.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

prophepy-0.0.1-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page