Skip to content

gabrielfalcao/sure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d10d1de · Feb 10, 2017
Jun 10, 2016
Feb 10, 2017
Feb 10, 2017
Feb 10, 2017
Oct 17, 2016
Jun 17, 2016
Feb 9, 2017
Feb 10, 2017
Feb 1, 2013
Jun 29, 2016
Dec 21, 2016
Jun 21, 2016
Dec 21, 2016
Jun 5, 2016
Dec 24, 2016
Dec 24, 2016

Repository files navigation

sure

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

Build Status PyPI package version PyPI python versions Join the chat at https://gitter.im/gabrielfalcao/sure

Installing

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

Documentation

Available in the website or under the docs directory.

You can also build the documentation locally using sphinx:

make docs

Here is a tease

Equality

(number).should.equal(number)

import sure

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

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

Assert dictionary and its contents

{'foo': 'bar'}.should.equal({'foo': 'bar'})
{'foo': 'bar'}.should.have.key('foo').which.should.equal('bar')

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

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