
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
.. image:: https://img.shields.io/travis/Ralph-Wang/should.svg?style-flat-square :target: https://travis-ci.org/Ralph-Wang/should .. image:: https://img.shields.io/coveralls/Ralph-Wang/should.svg?style-flat-square :target: https://coveralls.io/r/Ralph-Wang/should
Bugs: https://github.com/Ralph-Wang/should/issues More Details: https://github.com/Ralph-Wang/should/blob/master/README.md
::
pip install should
.. code-block:: python
from should import it
# 一般的断言
it(1).should.be.int
it({}).should.be.no.ok
it(2).should.be.equal(2)
it(10).should.be.no.equal(8)
it([1,2,3]).should.contain(3)
# lambda 版异常断言
it(lambda: int('abc')).should.throw(ValueError)
it(lambda: int('123')).should.no.throw(ValueError)
.. _tests: https://github.com/Ralph-Wang/should/blob/master/tests
The MIT License
v0.5.4
* 增加 subclassof 接口
* 添加 shouldnt 取反属性
v0.5.3
v0.5.2
* 小重构, 删除 _flag 属性
* match/search 支持 list 和 dict. dict 只验证值
* .contain 支持 contain(v1, v2, v3)
v0.5.1
v0.5.0
* 删除原 `raises` 接口, 不再支持 with should.raises 语法
* `raises` 接口改为 `throw` 的等价接口
* `key` 会改变链式调用. 后续值为键所对应的值
v0.4.8
throw
在 2.* 只能接受 str
的问题v0.4.7
* 添加 `within` 接口
* should.py 文件中添加自文档
* 添加 `proper` / `own_proper` 接口
v0.4.6
search
接口, 与 match
等价, 但更贴近 Python re 的接口v0.4.5
* 增加 `match` 接口, 进行正则匹配断言
* 增加 `empty` 属性, 直接判断容器或序列是否为空
* 只有连接词, be, have 会出现在 Assertion Error 中
* `throw` 接口支持断言 throw 信息
v0.4.4
v0.4.3
* 类型断言如 `it(1).should.be.int` 支持所有内建类型
* 添加 `instanceof` 断言, 支持其它类型或弱类型断言
* 链式调用 'be'/'have' 时, Error 信息正确显示 have 和 be
FAQs
assert with should
We found that should demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.