{"id":13502137,"url":"https://github.com/smartfastlabs/equals","last_synced_at":"2025-03-29T10:32:47.729Z","repository":{"id":21963385,"uuid":"25288088","full_name":"smartfastlabs/equals","owner":"smartfastlabs","description":"Fuzzy equality objects for testing, a stricter version of Mock.Any.","archived":false,"fork":false,"pushed_at":"2025-03-06T05:04:29.000Z","size":388,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T05:01:52.774Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartfastlabs.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-16T05:40:49.000Z","updated_at":"2025-02-16T15:32:25.000Z","dependencies_parsed_at":"2024-10-31T21:31:40.457Z","dependency_job_id":"a83aa48f-a1a1-4c1a-9cb8-77ff9c2bec05","html_url":"https://github.com/smartfastlabs/equals","commit_stats":null,"previous_names":["smartfastlabs/equals","toddsifleet/equals"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfastlabs%2Fequals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfastlabs%2Fequals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfastlabs%2Fequals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartfastlabs%2Fequals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartfastlabs","download_url":"https://codeload.github.com/smartfastlabs/equals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174207,"owners_count":20735406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:03.330Z","updated_at":"2025-03-29T10:32:47.343Z","avatar_url":"https://github.com/smartfastlabs.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"A mock equality tool for testing\n================================\n\n.. image:: https://badge.fury.io/py/equals.svg\n    :target: https://badge.fury.io/py/equals\n\n.. image:: https://readthedocs.org/projects/equals/badge/?version=latest\n    :target: https://equals.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://coveralls.io/repos/github/smartfastlabs/equals/badge.svg?branch=master\n    :target: https://coveralls.io/github/smartfastlabs/equals?branch=master\n\n\ntl;dr Equals is a stricter version of\n`Mock.Any \u003chttp://www.voidspace.org.uk/python/mock/helpers.html#any\u003e`__.\n\nEquals allows you to assert certain equality constraints between python\nobjects during testing. There are times where we don't want to assert\nabsolute equality, e.g. we need to ensure two lists have the same\nelements, but don't care about order.  This was designed specifically for\nusage with `Mock \u003chttps://pypi.python.org/pypi/mock\u003e`_ and `dobles \u003chttps://github.com/smartfastlabs/dobles\u003e`_.\n\n**Full Documentation is available at http://equals.readthedocs.org/en/latest/.**\n\nUsage\n=====\n\nWith Mock:\n----------\n\n::\n\n    from mock import Mock\n    from equals import any_dict\n\n    test_object = Mock()\n    test_object.method({'bob': 'barker'})\n    test_object.method.assert_called_with(any_dict)\n\ndobles:\n-------\n\n::\n\n    from dobles import expect\n    from equals import any_string\n\n\n    class TestClass(object):\n        def method(self, arg):\n            return arg\n\n\n    test_object = TestClass()\n    expect(test_object).method.with_args(any_string.containing('bob'))\n\n    test_object.method('bob barker')\n\n\n\nAPI\n===\n\n**NOTE: These are examples, each of these examples illustrates a way that equals could be used while writing unit tests.**\n\nstrings:\n--------\n\n::\n\n    from equals import any_string\n\n    any_string.containing('abc') == '123 abc 456'\n    any_string.starting_with('abc') == 'abcdef'\n    any_string.ending_with('abc') == '123abc'\n    any_string.matching('^abc$') == 'abc'\n\nnumbers:\n--------\n\n::\n\n    from equals import any_number\n\n    any_number.less_than(5) == 4\n    any_number.less_than_or_equal_to(5) == 5\n    any_number.greater_than(4) == 5\n    any_number.greater_than_or_equal_to(5) == 5\n    any_number.between(1, 3) == 2\n\ndictionaries:\n-------------\n\n::\n\n    from equals import any_dict\n\n    any_dict.containing(1, 2) == {1: 2, 2:3, 4:5}\n    any_dict.containing(foo='bar') == {\n        'foo': 'bar',\n        'bob': 'barker'\n    }\n    any_dict.not_containing(1, foo=5) == {'foo':3, 4:5}\n\niterators:\n----------\n\n::\n\n    from equals import any_iterable\n\n    any_iterable.containing(1, 2, 3) == [1, 2, 3, 4, 5]\n    any_iterable.containing_only(1, 2, 3) == [2, 3, 1]\n    any_iterable.not_containing(1, 2) == [3, 4]\n    any_iterable.with_length(2) == [3, 4]\n\nobjects:\n--------\n\n::\n\n    from equals import anything\n\n    anything == None\n    anything == True\n    anything == {1: 1}\n    anything_true == 'dd'\n    anything_false == ''\n\n    instance_of(dict) == {}\n    anything.with_attrs(foo='bar', bob='barker') == Dummy('bar', 'barker')\n    instance_of(Dummy).with_attrs(foo='bar', bob='barker') == Dummy('bar', 'barker')\n\n\nInstallation:\n=============\n\n::\n\n    \u003e\u003e pip install equals\n\n\nDevelopment\n===========\n\nSource code is available at https://github.com/smartfastlabs/equals.\n\nTo install the dependencies on a fresh clone of the repository, run ``make bootstrap``.\n\nTo run the test suite, run ``make test``.\n\nTo build the documentation locally, run ``make docs``.\n\n\nLicense\n=======\n\nMIT: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartfastlabs%2Fequals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartfastlabs%2Fequals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartfastlabs%2Fequals/lists"}