Complete documentation is available at https://fudge.readthedocs.org/en/latest/
Fudge is a Python module for using fake objects (mocks and stubs) to test real ones.
In readable Python code, you declare what methods are available on your fake and how they should be called. Then you inject that into your application and start testing. This declarative approach means you don’t have to record and playback actions and you don’t have to inspect your fakes after running code. If the fake object was used incorrectly then you’ll see an informative exception message with a traceback that points to the culprit.
Here is a quick preview of how you can test code that sends email without actually sending email:
@fudge.patch('smtplib.SMTP')
def test_mailer(FakeSMTP):
# Declare how the SMTP class should be used:
(FakeSMTP.expects_call()
.expects('connect')
.expects('sendmail').with_arg_count(3))
# Run production code:
send_mail()
# ...expectations are verified automatically at the end of the test
Metadata
Release files for fudge 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fudge-1.1.1.tar.gz | 87.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fudge-1.1.1-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size: 168.7 kB
Release files / fudge-1.1.1.tar.gz
| Download URL | fudge-1.1.1.tar.gz |
|---|---|
| Size | 87.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9929d87bb38711112734d99a2c7ada5dc39ef67b758b1e55f4c779c3634efdc
|
|
BLAKE2b-256 checksum How to use checksums |
6571f44731d536a9b146c5d9a4eb9d3bacd8aae7dbb3597382f3f9bd3d015577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / fudge-1.1.1-py2.7.egg
| Download URL | fudge-1.1.1-py2.7.egg |
|---|---|
| Size | 81.1 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
5a9335d2c0bf29ebd646d4bd102b335107ce3566d278270453001f3e648b63e4
|
|
BLAKE2b-256 checksum How to use checksums |
8add1b36185fa29a5436c3c8d7841ca58b058a6c78d50f248f420cbe21b3bcad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |