Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install should-dsl

How to install should_dsl

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install should-dsl
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.1.2 Available View build log
2.0a4 Available View build log
2.0a4
2.1.2Never BuiltWhy not?
2.0a4 Available View build log
Windows (64-bit)
2.0a4
2.1.2Never BuiltWhy not?
2.0a4 Available View build log
2.0a4
2.1.2Never BuiltWhy not?
2.0a4 Available View build log
Mac OS X (10.5+)
2.1.2 Available View build log
2.0a4 Available View build log
2.1.2 Available View build log
2.1.1 Failed View build log
2.0a4 Available View build log
Linux (32-bit)
2.1.2 Available View build log
2.1.1 Available View build log
2.0a4 Available View build log
2.1.2 Available View build log
2.1.1 Failed View build log
2.0a4 Available View build log
Linux (64-bit)
2.1.2 Available View build log
2.1.1 Available View build log
2.0a4 Available View build log
2.1.2 Available View build log
2.1.1 Failed View build log
2.0a4 Available View build log
2.1.2 Available View build log
 
License
MIT License
Imports
Lastest release
version 2.1.2 on Nov 20th, 2012

The goal of Should-DSL is to write should expectations in Python as clear and readable as possible, using "almost" natural language (limited - sometimes - by the Python language constraints).

In order to use this DSL, you need to import should and should_not objects from should_dsl module.

For example:

>>> from should_dsl import should

>>> 1 |should| equal_to(1)
>>> 'should' |should| include('oul')
>>> 3 |should| be_into([0, 1, 2])
Traceback (most recent call last):
...
ShouldNotSatisfied: 3 is not into [0, 1, 2]

The equal_to matcher verifies object equality. If you want to ensure identity, you must use be as matcher:

>>> 2 |should| be(2)

A nice example of exceptions would be:

>>> def raise_zerodivisionerror():
...     return 1/0
>>> raise_zerodivisionerror |should| throw(ZeroDivisionError)

should has a negative version: should_not:

>>> from should_dsl import should_not

>>> 2 |should_not| be_into([1, 3, 5])
>>> 'should' |should_not| include('oul')
Traceback (most recent call last):
...
ShouldNotSatisfied: 'should' does include 'oul'

Subscribe to package updates

Last updated Nov 20th, 2012

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.