cwacek / sure

utility belt for automated testing in python (inspired by @visionmedia's should.js)

Home Page:http://falcao.it/sure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sure 1.2.5

A testing library for python with powerful and flexible assertions. Sure is heavily inspired by should.js

Build Status

Installing

user@machine:~$ [sudo] pip install sure

Documentation

Available in the website or under the spec directory.

You can also build the documentation locally using markment:

pip install markment
markment --server --theme=rtd ./spec/

Here is a tease

Equality

(number).should.equal(number)

import sure

(4).should.be.equal(2 + 2)
(7.5).should.eql(3.5 + 4)
(2).should.equal(8 / 4)

(3).shouldnt.be.equal(5)

{'a': 'collection'}.should.equal({'a': 'collection'}) does deep comparison

{'foo': 'bar'}.should.equal({'foo': 'bar'})
{'foo': 'bar'}.should.eql({'foo': 'bar'})
{'foo': 'bar'}.must.be.equal({'foo': 'bar'})

"A string".lower().should.equal("a string") also works

"Awesome ASSERTIONS".lower().split().should.equal(['awesome', 'assertions'])

About

utility belt for automated testing in python (inspired by @visionmedia's should.js)

http://falcao.it/sure

License:GNU General Public License v3.0


Languages

Language:Python 100.0%