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()

Install

pip install prophepy

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.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

prophepy-0.0.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file prophepy-0.0.4.tar.gz.

File metadata

  • Download URL: prophepy-0.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/4.14.98-1-MANJARO

File hashes

Hashes for prophepy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9009ba16d06cfd7c4048864013198866b809fe5d05f7d0fd25699dde90734ad3
MD5 930f7c1227951e911cc06687241cf971
BLAKE2b-256 b1f19e3a00ae4f13d6a8d4c1d3fb9c1cfb7d6ae813e71aea608136280d962018

See more details on using hashes here.

File details

Details for the file prophepy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: prophepy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/4.14.98-1-MANJARO

File hashes

Hashes for prophepy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4730f163ccccceb2aaaa908c70a0192dd2992bbad171bb6d74aec27bdf09c9c
MD5 33bf334672e1706386106e3c1addf755
BLAKE2b-256 16b27694e88ffac6ed0ee9c4cc363ab1481defd324cc2a91768cbc476315778c

See more details on using hashes here.

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