Metadata-Version: 2.4
Name: surer
Version: 0.0.3
Home-page: https://github.com/getmoto/surer
Author: Gabriel Falcao
Author-email: "gabriel@nacaolivre.org"
Maintainer: Bert Blommers
License: GPL-3.0-or-later
Project-URL: Documentation, https://surer.readthedocs.io/en/latest/
Project-URL: Issue tracker, https://github.com/getmoto/surer/issues
Keywords: test assertions fluent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: COPYING
Dynamic: license-file

surer
=====



.. image:: https://img.shields.io/pypi/dm/surer
   :target: https://pypi.org/project/surer

.. image:: https://github.com/getmoto/surer/workflows/Sure%20Tests/badge.svg
   :target: https://github.com/getmoto/surer/actions?query=workflow%3A%22Sure+Tests%22

.. image:: https://img.shields.io/readthedocs/sure
   :target: https://surer.readthedocs.io/

.. image:: https://img.shields.io/github/license/getmoto/surer?label=Github%20License
   :target: https://github.com/getmoto/surer/blob/master/LICENSE

.. image:: https://img.shields.io/pypi/v/surer
   :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/l/surer?label=PyPi%20License
   :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/format/surer
   :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/status/surer
   :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/pyversions/surer
   :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/implementation/surer
   :target: https://pypi.org/project/surer


An idiomatic testing library for python with powerful and flexible assertions, created by `Gabriel Falcão <https://github.com/gabrielfalcao>`_.
Sure's developer experience is inspired and modeled after `RSpec Expectations
<http://rspec.info/documentation/3.5/rspec-expectations/>`_ and
`should.js <https://github.com/shouldjs/should.js>`_.

This is a fork of Gabriel's `sure` library, maintained at `http://github.com/getmoto/surer`. It provides support for more recent Python-versions, but does not differ in functionality.

Installing
----------

.. code:: bash

    $ pip install surer

Documentation
-------------

Available in the `website <https://surer.readthedocs.io/en/latest/>`__ or under the
``docs`` directory.

You can also build the documentation locally using sphinx:

.. code:: bash

    make docs

Here is a tease
---------------

Equality
~~~~~~~~

(number).should.equal(number)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

    import surer

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

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

Assert dictionary and its contents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

    {'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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

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