python for python中自动测试的实用程序带
sure的Python项目详细描述
一个具有强大和灵活断言的Python习惯测试库。当然 深受RSpec Expectations和should.js的启发
安装
$ pip install sure
下面是一个摘要
相等
(数字).should.equal(数字)
importsure(4).should.be.equal(2+2)(7.5).should.eql(3.5+4)(3).shouldnt.be.equal(5)
断言字典及其内容
{'foo':'bar'}.should.equal({'foo':'bar'}){'foo':'bar'}.should.have.key('foo').which.should.equal('bar')
“a string”.lower().should.equal(“a string”)也可以
"Awesome ASSERTIONS".lower().split().should.equal(['awesome','assertions'])