{"id":13816693,"url":"https://github.com/assertpy/assertpy","last_synced_at":"2026-02-21T03:01:56.506Z","repository":{"id":24647110,"uuid":"28056948","full_name":"assertpy/assertpy","owner":"assertpy","description":"Simple assertion library for unit testing in python with a fluent API","archived":false,"fork":false,"pushed_at":"2025-06-15T18:57:28.000Z","size":558,"stargazers_count":526,"open_issues_count":26,"forks_count":77,"subscribers_count":29,"default_branch":"main","last_synced_at":"2026-02-12T03:34:56.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://assertpy.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/assertpy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2014-12-15T21:24:51.000Z","updated_at":"2026-01-19T20:44:47.000Z","dependencies_parsed_at":"2024-02-11T23:33:56.609Z","dependency_job_id":"ab4e0cf1-f2ae-4143-b6ab-173e09c6de39","html_url":"https://github.com/assertpy/assertpy","commit_stats":{"total_commits":310,"total_committers":16,"mean_commits":19.375,"dds":0.08709677419354833,"last_synced_commit":"4f830045d78004946db562536b0c875b1a2180c4"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/assertpy/assertpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertpy%2Fassertpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertpy%2Fassertpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertpy%2Fassertpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertpy%2Fassertpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assertpy","download_url":"https://codeload.github.com/assertpy/assertpy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertpy%2Fassertpy/sbom","scorecard":{"id":213096,"data":{"date":"2025-08-11","repo":{"name":"github.com/assertpy/assertpy","commit":"0a8c4f66d153d11d933e1f9f255d1d4f516d2ee3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 8/27 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T01:07:14.170Z","repository_id":24647110,"created_at":"2025-08-17T01:07:14.170Z","updated_at":"2025-08-17T01:07:14.170Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29491998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-04T05:00:50.101Z","updated_at":"2026-02-21T03:01:56.484Z","avatar_url":"https://github.com/assertpy.png","language":"Python","readme":"# assertpy\n\nSimple assertions library for unit testing in Python with a nice fluent API.  Supports both Python 2 and 3.\n\n[![Build Status](https://travis-ci.org/assertpy/assertpy.svg?branch=main)](https://travis-ci.org/assertpy/assertpy)\n[![Coverage Status](https://coveralls.io/repos/github/assertpy/assertpy/badge.svg?branch=main)](https://coveralls.io/github/assertpy/assertpy?branch=main)\n\n\n## Usage\n\nJust import the `assert_that` function, and away you go...\n\n```py\nfrom assertpy import assert_that\n\ndef test_something():\n    assert_that(1 + 2).is_equal_to(3)\n    assert_that('foobar').is_length(6).starts_with('foo').ends_with('bar')\n    assert_that(['a', 'b', 'c']).contains('a').does_not_contain('x')\n```\n\nOf course, `assertpy` works best with a python test runner like [pytest](http://pytest.org/) (our favorite) or [Nose](http://nose.readthedocs.org/).\n\n\n## Installation\n\n### Install via pip\n[![PyPI Badge](https://badge.fury.io/py/assertpy.svg)](https://pypi.org/project/assertpy/)\n\nThe `assertpy` library is available via [PyPI](https://pypi.org/project/assertpy/).\nJust install with:\n\n```\npip install assertpy\n```\n\n### Install via conda\n\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/assertpy.svg)](https://anaconda.org/conda-forge/assertpy)\n[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/assertpy.svg)](https://anaconda.org/conda-forge/assertpy)\n\nOr, if you are a big fan of [conda](https://conda.io/) like we are, there is an [assertpy-feedstock](https://github.com/conda-forge/assertpy-feedstock) for [Conda-Forge](https://conda-forge.org/) that you can use:\n\n```\nconda install assertpy --channel conda-forge\n```\n\n\n## Docs\n\nThe fluent API of `assertpy` is designed to create compact, yet readable tests.\nThe API has been modeled after other fluent testing APIs, especially the awesome\n[AssertJ](https://assertj.github.io/doc/) assertion library for Java.  Of course, in the `assertpy` library everything is fully pythonic and designed to take full advantage of the dynamism in the Python runtime.\n\nAll assertions, with usage examples, are documented here:  \nhttps://assertpy.github.io/docs.html\n\nAnd there are hundreds of examples below.  Read on...\n\n### Strings\n\nMatching strings:\n\n```py\nassert_that('').is_not_none()\nassert_that('').is_empty()\nassert_that('').is_false()\nassert_that('').is_type_of(str)\nassert_that('').is_instance_of(str)\n\nassert_that('foo').is_length(3)\nassert_that('foo').is_not_empty()\nassert_that('foo').is_true()\nassert_that('foo').is_alpha()\nassert_that('123').is_digit()\nassert_that('foo').is_lower()\nassert_that('FOO').is_upper()\nassert_that('foo').is_iterable()\nassert_that('foo').is_equal_to('foo')\nassert_that('foo').is_not_equal_to('bar')\nassert_that('foo').is_equal_to_ignoring_case('FOO')\n\nassert_that(u'foo').is_unicode()  # on python 2\nassert_that('foo').is_unicode()   # on python 3\n\nassert_that('foo').contains('f')\nassert_that('foo').contains('f','oo')\nassert_that('foo').contains_ignoring_case('F','oO')\nassert_that('foo').does_not_contain('x')\nassert_that('foo').contains_only('f','o')\nassert_that('foo').contains_sequence('o','o')\n\nassert_that('foo').contains_duplicates()\nassert_that('fox').does_not_contain_duplicates()\n\nassert_that('foo').is_in('foo','bar','baz')\nassert_that('foo').is_not_in('boo','bar','baz')\nassert_that('foo').is_subset_of('abcdefghijklmnopqrstuvwxyz')\n\nassert_that('foo').starts_with('f')\nassert_that('foo').ends_with('oo')\n\nassert_that('foo').matches(r'\\w')\nassert_that('123-456-7890').matches(r'\\d{3}-\\d{3}-\\d{4}')\nassert_that('foo').does_not_match(r'\\d+')\n```\n\nRegular expressions can be tricky.  Be sure to use raw strings (prefix the pattern string with `r`) for the regex pattern to be matched.  Also, note that the `matches()` function passes for partial matches (as does the [re.match](https://docs.python.org/3/library/re.html#re.match) function that underlies it). If you want to match the entire string, just include anchors in the regex pattern.\n\n```py\n# partial matches, these all pass\nassert_that('foo').matches(r'\\w')\nassert_that('foo').matches(r'oo')\nassert_that('foo').matches(r'\\w{2}')\n\n# match the entire string with an anchored regex pattern, passes\nassert_that('foo').matches(r'^\\w{3}$')\n\n# fails\nassert_that('foo').matches(r'^\\w{2}$')\n```\n\nAdditionally, while `assertpy` `matches()` assertion does not have support for [re.match](https://docs.python.org/3/library/re.html#re.match) flags such as `re.MULTILINE` or `re.DOTALL`, it works as expected with _inline flags_ in the pattern.\n\n```py\ns = \"\"\"bar\nfoo\nbaz\"\"\"\n\n# use multiline inline flag (?m)\nassert_that(s).matches(r'(?m)^foo$')\n\n# use dotall inline flag (?s)\nassert_that(s).matches(r'(?s)b(.*)z')\n```\n\n### Numbers\n\nMatching integers:\n\n```py\nassert_that(0).is_not_none()\nassert_that(0).is_false()\nassert_that(0).is_type_of(int)\nassert_that(0).is_instance_of(int)\n\nassert_that(0).is_zero()\nassert_that(1).is_not_zero()\nassert_that(1).is_positive()\nassert_that(-1).is_negative()\n\nassert_that(123).is_equal_to(123)\nassert_that(123).is_not_equal_to(456)\n\nassert_that(123).is_greater_than(100)\nassert_that(123).is_greater_than_or_equal_to(123)\nassert_that(123).is_less_than(200)\nassert_that(123).is_less_than_or_equal_to(200)\nassert_that(123).is_between(100, 200)\nassert_that(123).is_close_to(100, 25)\n\nassert_that(1).is_in(0,1,2,3)\nassert_that(1).is_not_in(-1,-2,-3)\n```\n\nMatching floats:\n\n```py\nassert_that(0.0).is_not_none()\nassert_that(0.0).is_false()\nassert_that(0.0).is_type_of(float)\nassert_that(0.0).is_instance_of(float)\n\nassert_that(123.4).is_equal_to(123.4)\nassert_that(123.4).is_not_equal_to(456.7)\n\nassert_that(123.4).is_greater_than(100.1)\nassert_that(123.4).is_greater_than_or_equal_to(123.4)\nassert_that(123.4).is_less_than(200.2)\nassert_that(123.4).is_less_than_or_equal_to(123.4)\nassert_that(123.4).is_between(100.1, 200.2)\nassert_that(123.4).is_close_to(123, 0.5)\n\nassert_that(float('NaN')).is_nan()\nassert_that(123.4).is_not_nan()\nassert_that(float('Inf')).is_inf()\nassert_that(123.4).is_not_inf()\n```\n\nOf course, using `is_equal_to()` with a `float` value is just asking for trouble. You'll always want to use the assertions methods like `is_close_to()` and `is_between()`.\n\n\n### Lists\n\nMatching lists:\n\n```py\nassert_that([]).is_not_none()\nassert_that([]).is_empty()\nassert_that([]).is_false()\nassert_that([]).is_type_of(list)\nassert_that([]).is_instance_of(list)\nassert_that([]).is_iterable()\n\nassert_that(['a','b']).is_length(2)\nassert_that(['a','b']).is_not_empty()\nassert_that(['a','b']).is_equal_to(['a','b'])\nassert_that(['a','b']).is_not_equal_to(['b','a'])\n\nassert_that(['a','b']).contains('a')\nassert_that(['a','b']).contains('b','a')\nassert_that(['a','b']).does_not_contain('x','y')\nassert_that(['a','b']).contains_only('a','b')\nassert_that(['a','a']).contains_only('a')\nassert_that(['a','b','c']).contains_sequence('b','c')\nassert_that(['a','b']).is_subset_of(['a','b','c'])\nassert_that(['a','b','c']).is_sorted()\nassert_that(['c','b','a']).is_sorted(reverse=True)\n\nassert_that(['a','x','x']).contains_duplicates()\nassert_that(['a','b','c']).does_not_contain_duplicates()\n\nassert_that(['a','b','c']).starts_with('a')\nassert_that(['a','b','c']).ends_with('c')\n```\n\n#### List Flattening\n\nLists of lists can be flattened on any item (by index) using the `extracting` helper (see [dict flattening](#dict-flattening)):\n\n```py\npeople = [['Fred', 'Smith'], ['Bob', 'Barr']]\nassert_that(people).extracting(0).is_equal_to(['Fred','Bob'])\nassert_that(people).extracting(-1).is_equal_to(['Smith','Barr'])\n```\n\n### Tuples\n\nMatching tuples:\n\n```py\nassert_that(()).is_not_none()\nassert_that(()).is_empty()\nassert_that(()).is_false()\nassert_that(()).is_type_of(tuple)\nassert_that(()).is_instance_of(tuple)\nassert_that(()).is_iterable()\n\nassert_that((1,2,3)).is_length(3)\nassert_that((1,2,3)).is_not_empty()\nassert_that((1,2,3)).is_equal_to((1,2,3))\nassert_that((1,2,3)).is_not_equal_to((1,2,4))\n\nassert_that((1,2,3)).contains(1)\nassert_that((1,2,3)).contains(3,2,1)\nassert_that((1,2,3)).does_not_contain(4,5,6)\nassert_that((1,2,3)).contains_only(1,2,3)\nassert_that((1,1,1)).contains_only(1)\nassert_that((1,2,3)).contains_sequence(2,3)\nassert_that((1,2,3)).is_subset_of((1,2,3,4))\nassert_that((1,2,3)).is_sorted()\nassert_that((3,2,1)).is_sorted(reverse=True)\n\nassert_that((1,2,2)).contains_duplicates()\nassert_that((1,2,3)).does_not_contain_duplicates()\n\nassert_that((1,2,3)).starts_with(1)\nassert_that((1,2,3)).ends_with(3)\n```\n\n#### Tuple Flattening\n\nTuples of tuples can be flattened on any item (by index) using the `extracting` helper (see [dict flattening](#dict-flattening)):\n\n```py\npoints = ((1,2,3),(4,5,6))\nassert_that(points).extracting(0).is_equal_to([1, 4])\nassert_that(points).extracting(-1).is_equal_to([3, 6])\n```\n\n### Dicts\n\nMatching dicts:\n\n```py\nassert_that({}).is_not_none()\nassert_that({}).is_empty()\nassert_that({}).is_false()\nassert_that({}).is_type_of(dict)\nassert_that({}).is_instance_of(dict)\n\nassert_that({'a':1,'b':2}).is_length(2)\nassert_that({'a':1,'b':2}).is_not_empty()\nassert_that({'a':1,'b':2}).is_equal_to({'a':1,'b':2})\nassert_that({'a':1,'b':2}).is_equal_to({'b':2,'a':1})\nassert_that({'a':1,'b':2}).is_not_equal_to({'a':1,'b':3})\n\nassert_that({'a':1,'b':2}).contains('a')\nassert_that({'a':1,'b':2}).contains('b','a')\nassert_that({'a':1,'b':2}).does_not_contain('x')\nassert_that({'a':1,'b':2}).does_not_contain('x','y')\nassert_that({'a':1,'b':2}).contains_only('a','b')\nassert_that({'a':1,'b':2}).is_subset_of({'a':1,'b':2,'c':3})\n\n# contains_key() is just an alias for contains()\nassert_that({'a':1,'b':2}).contains_key('a')\nassert_that({'a':1,'b':2}).contains_key('b','a')\n\n# does_not_contain_key() is just an alias for does_not_contain()\nassert_that({'a':1,'b':2}).does_not_contain_key('x')\nassert_that({'a':1,'b':2}).does_not_contain_key('x','y')\n\nassert_that({'a':1,'b':2}).contains_value(1)\nassert_that({'a':1,'b':2}).contains_value(2,1)\nassert_that({'a':1,'b':2}).does_not_contain_value(3)\nassert_that({'a':1,'b':2}).does_not_contain_value(3,4)\n\nassert_that({'a':1,'b':2}).contains_entry({'a':1})\nassert_that({'a':1,'b':2}).contains_entry({'a':1},{'b':2})\nassert_that({'a':1,'b':2}).does_not_contain_entry({'a':2})\nassert_that({'a':1,'b':2}).does_not_contain_entry({'a':2},{'b':1})\n```\n\n#### Dict Comparison\n\nDict keys can optionally be ignored or included when using the `is_equal_to()` assertion.\n\nIgnore dict keys with the `ignore` keyword argument:\n\n```py\n# ignore a single key\nassert_that({'a':1,'b':2}).is_equal_to({'a':1}, ignore='b')\n\n# ignore multiple keys using a list\nassert_that({'a':1,'b':2,'c':3}).is_equal_to({'a':1}, ignore=['b','c'])\n\n# ignore nested keys using a tuple\nassert_that({'a':1,'b':{'c':2,'d':3}}).is_equal_to({'a':1,'b':{'c':2}}, ignore=('b','d'))\n```\n\nOr include dict keys with the `include` keyword argument:\n\n```py\n# include a single key\nassert_that({'a':1,'b':2}).is_equal_to({'a':1}, include='a')\n\n# include multiple keys using a list\nassert_that({'a':1,'b':2,'c':3}).is_equal_to({'a':1,'b':2}, include=['a','b'])\n\n# include nested keys using a tuple\nassert_that({'a':1,'b':{'c':2,'d':3}}).is_equal_to({'b':{'d':3}}, include=('b','d'))\n```\n\nOr do both:\n\n```py\nassert_that({'a':1,'b':{'c':2,'d':3,'e':4,'f':5}}).is_equal_to(\n    {'b':{'d':3,'f':5}},\n    ignore=[('b','c'),('b','e')],\n    include='b'\n)\n```\n\n#### Dict Flattening\n\nLists of dicts can be flattened on key using the `extracting` helper (see [extracting attributes](#extracting-attributes-from-objects)):\n\n```py\nfred = {'first_name': 'Fred', 'last_name': 'Smith'}\nbob = {'first_name': 'Bob', 'last_name': 'Barr'}\npeople = [fred, bob]\n\nassert_that(people).extracting('first_name').is_equal_to(['Fred','Bob'])\nassert_that(people).extracting('first_name').contains('Fred','Bob')\n```\n\n#### Dict Key Assertions\n\nFluent assertions against the value of a given key can be done by prepending `has_` to the key name (see [dynamic assertions](#dynamic-assertions-on-objects)):\n\n```py\nfred = {'first_name': 'Fred', 'last_name': 'Smith', 'shoe_size': 12}\n\nassert_that(fred).has_first_name('Fred')\nassert_that(fred).has_last_name('Smith')\nassert_that(fred).has_shoe_size(12)\n```\n\n\n### Sets\n\nMatching sets:\n\n```py\nassert_that(set([])).is_not_none()\nassert_that(set([])).is_empty()\nassert_that(set([])).is_false()\nassert_that(set([])).is_type_of(set)\nassert_that(set([])).is_instance_of(set)\n\nassert_that(set(['a','b'])).is_length(2)\nassert_that(set(['a','b'])).is_not_empty()\nassert_that(set(['a','b'])).is_equal_to(set(['a','b']))\nassert_that(set(['a','b'])).is_equal_to(set(['b','a']))\nassert_that(set(['a','b'])).is_not_equal_to(set(['a','x']))\n\nassert_that(set(['a','b'])).contains('a')\nassert_that(set(['a','b'])).contains('b','a')\nassert_that(set(['a','b'])).does_not_contain('x','y')\nassert_that(set(['a','b'])).contains_only('a','b')\nassert_that(set(['a','b'])).is_subset_of(set(['a','b','c']))\nassert_that(set(['a','b'])).is_subset_of(set(['a']), set(['b']))\n```\n\n\n### Booleans\n\nMatching booleans:\n\n```py\nassert_that(True).is_true()\nassert_that(False).is_false()\nassert_that(True).is_type_of(bool)\n```\n\n\n### None\n\nMatching `None`:\n\n```py\nassert_that(None).is_none()\nassert_that('').is_not_none()\nassert_that(None).is_type_of(type(None))\n```\n\n\n### Dates\n\nMatching dates:\n\n```py\nimport datetime\n\ntoday = datetime.datetime.today()\nyesterday = today - datetime.timedelta(days=1)\n\nassert_that(yesterday).is_before(today)\nassert_that(today).is_after(yesterday)\n```\n\nYou can also make assertions about date equality (ignoring various units of time) like this:\n\n```py\ntoday_0us = today - datetime.timedelta(microseconds=today.microsecond)\ntoday_0s = today - datetime.timedelta(seconds=today.second)\ntoday_0h = today - datetime.timedelta(hours=today.hour)\n\nassert_that(today).is_equal_to_ignoring_milliseconds(today_0us)\nassert_that(today).is_equal_to_ignoring_seconds(today_0s)\nassert_that(today).is_equal_to_ignoring_time(today_0h)\nassert_that(today).is_equal_to(today)\n```\n\nYou can use these numeric assertions on dates:\n\n```py\nmiddle = today - datetime.timedelta(hours=12)\nhours_24 = datetime.timedelta(hours=24)\n\nassert_that(today).is_greater_than(yesterday)\nassert_that(yesterday).is_less_than(today)\nassert_that(middle).is_between(yesterday, today)\n\n#note that the tolerance must be a datetime.timedelta object\nassert_that(yesterday).is_close_to(today, hours_24)\n```\n\nLastly, because datetime is an object we can easily test the properties of a given date by prepending `has_` to the property name (see [dynamic assertions](#dynamic-assertions-on-objects)):\n\n```py\n# 1980-01-02 03:04:05.000006\nx = datetime.datetime(1980, 1, 2, 3, 4, 5, 6)\n\nassert_that(x).has_year(1980)\nassert_that(x).has_month(1)\nassert_that(x).has_day(2)\nassert_that(x).has_hour(3)\nassert_that(x).has_minute(4)\nassert_that(x).has_second(5)\nassert_that(x).has_microsecond(6)\n```\n\nCurrently, `assertpy` only supports dates via the `datetime` type.\n\n\n### Files\n\nMatching files:\n\n```py\nassert_that('foo.txt').exists()\nassert_that('missing.txt').does_not_exist()\nassert_that('foo.txt').is_file()\n\nassert_that('mydir').exists()\nassert_that('missing_dir').does_not_exist()\nassert_that('mydir').is_directory()\n\nassert_that('foo.txt').is_named('foo.txt')\nassert_that('foo.txt').is_child_of('mydir')\n```\n\nMatching file contents is done using the `contents_of()` helper to read the file into a string with the given encoding (if no encoding is given it defaults to `utf-8`).  Once the file is read into a string, you can make quick work of it using the `assertpy` string assertions like this:\n\n```py\nfrom assertpy import assert_that, contents_of\n\ncontents = contents_of('foo.txt', 'ascii')\nassert_that(contents).starts_with('foo').ends_with('bar').contains('oob')\n```\n\n\n### Objects\n\nMatching an object:\n\n```py\nfred = Person('Fred','Smith')\n\nassert_that(fred).is_not_none()\nassert_that(fred).is_true()\nassert_that(fred).is_type_of(Person)\nassert_that(fred).is_instance_of(object)\nassert_that(fred).is_same_as(fred)\n```\n\nMatching an attribute, a property, and a method:\n\n```py\nassert_that(fred.first_name).is_equal_to('Fred')\nassert_that(fred.name).is_equal_to('Fred Smith')\nassert_that(fred.say_hello()).is_equal_to('Hello, Fred!')\n```\n\nGiven `fred` is an instance of the following `Person` class:\n\n```py\nclass Person(object):\n    def __init__(self, first_name, last_name):\n        self.first_name = first_name\n        self.last_name = last_name\n\n    @property\n    def name(self):\n        return '%s %s' % (self.first_name, self.last_name)\n\n    def say_hello(self):\n        return 'Hello, %s!' % self.first_name\n```\n\n\n#### Extracting Attributes from Objects\n\nIt is frequently necessary to test collections of objects.  The `assertpy` library includes an `extracting` helper to flatten the collection on a given attribute, like this:\n\n```py\nfred = Person('Fred','Smith')\nbob = Person('Bob','Barr')\npeople = [fred, bob]\n\nassert_that(people).extracting('first_name').is_equal_to(['Fred','Bob'])\nassert_that(people).extracting('first_name').contains('Fred','Bob')\nassert_that(people).extracting('first_name').does_not_contain('Charlie')\n```\n\nOf course `extracting` works with subclasses too...suppose we create a simple class hierarchy by creating a `Developer` subclass of `Person`, like this:\n\n```py\nclass Developer(Person):\n    def say_hello(self):\n        return '%s writes code.' % self.first_name\n```\n\nTesting a mixed collection of parent and child objects works as expected:\n\n```py\nfred = Person('Fred','Smith')\njoe = Developer('Joe','Coder')\npeople = [fred, joe]\n\nassert_that(people).extracting('first_name').contains('Fred','Joe')\n```\n\nAdditionally, the `extracting` helper can accept a list of attributes to be extracted, and will flatten them into a list of tuples:\n\n```py\nassert_that(people).extracting('first_name', 'last_name').contains(('Fred','Smith'), ('Joe','Coder'))\n```\n\nLastly, `extracting` works on not just class attributes, but also properties, and even zero-argument methods:\n\n```py\nassert_that(people).extracting('name').contains('Fred Smith', 'Joe Coder')\nassert_that(people).extracting('say_hello').contains('Hello, Fred!', 'Joe writes code.')\n```\n\nAs noted above, the `extracting` helper also works on a collection of dicts:\n\n```py\nfred = {'first_name': 'Fred', 'last_name': 'Smith'}\nbob = {'first_name': 'Bob', 'last_name': 'Barr'}\npeople = [fred, bob]\n\nassert_that(people).extracting('first_name').contains('Fred','Bob')\n```\n\n##### Extracting and Filtering\n\nThe `extracting` helper can include a `filter` to keep only those items for which the given `filter` is truthy.  For example, suppose we have the following list of dicts we wish to test:\n\n```py\nusers = [\n    {'user': 'Fred', 'age': 36, 'active': True},\n    {'user': 'Bob', 'age': 40, 'active': False},\n    {'user': 'Johnny', 'age': 13, 'active': True}\n]\n```\n\nThe `filter` can be the name of a key (or attribute, or property, or zero-argument method) and the extracted items are kept if the corresponding value is truthy:\n\n```py\nassert_that(users).extracting('user', filter='active')\\\n    .is_equal_to(['Fred','Johnny'])\n```\n\nThe `filter` can be a `dict`-like object and the extracted items are kept if *all* corresponding key-value pairs are equal:\n\n```py\nassert_that(users).extracting('user', filter={'active': False})\\\n    .is_equal_to(['Bob'])\nassert_that(users).extracting('user', filter={'age': 36, 'active': True})\\\n    .is_equal_to(['Fred'])\n```\n\nThe `filter` can be any function (including an in-line `lambda`) that accepts as its single argument each item in the collection and the extracted items are kept if the function evaluates to `True`:\n\n```py\nassert_that(users).extracting('user', filter=lambda x: x['age'] \u003e 20)\\\n    .is_equal_to(['Fred', 'Bob'])\n```\n\n##### Extracting and Sorting\n\nThe `extracting` helper can include a `sort` to enforce order on the extracted items.\n\nThe `sort` can be the name of a key (or attribute, or property, or zero-argument method) and the extracted items are ordered by the corresponding values:\n\n```py\nassert_that(users).extracting('user', sort='age').is_equal_to(['Johnny','Fred','Bob'])\n```\n\nThe `sort` can be an `iterable` of names and the extracted items are ordered by corresponding value of the first name, ties are broken by the corresponding values of the second name, and so on:\n\n```py\nassert_that(users).extracting('user', sort=['active','age']).is_equal_to(['Bob','Johnny','Fred'])\n```\n\nThe `sort` can be any function (including an in-line `lambda`) that accepts as its single argument each item in the collection and the extracted items are ordered by the corresponding function return values:\n\n```py\nassert_that(users).extracting('user', sort=lambda x: -x['age'])\\\n    .is_equal_to(['Bob','Fred','Johnny'])\n```\n\n#### Dynamic Assertions on Objects\n\nWhen testing attributes of an object, the basic `assertpy` assertions can get a little verbose like this:\n\n```py\nfred = Person('Fred','Smith')\n\nassert_that(fred.first_name).is_equal_to('Fred')\nassert_that(fred.name).is_equal_to('Fred Smith')\nassert_that(fred.say_hello()).is_equal_to('Hello, Fred!')\n```\n\nSo, `assertpy` takes advantage of the awesome dyanmism in the Python runtime to provide dynamic assertions in the form of `has_\u003cname\u003e()` where `\u003cname\u003e` is the name of any attribute, property, or zero-argument method on the given object.\n\nUsing dynamic assertions, we can rewrite the above assertions in a more compact and readable way like this:\n\n```py\nassert_that(fred).has_first_name('Fred')\nassert_that(fred).has_name('Fred Smith')\nassert_that(fred).has_say_hello('Hello, Fred!')\n```\n\nSince `fred` has the attribute `first_name`, the dynamic assertion method `has_first_name()` is available.\nSimilarly, the property `name` can be tested via `has_name()` and the zero-argument method `say_hello()` via\nthe `has_say_hello()` assertion.\n\nAs noted above, dynamic assertions also work on dicts:\n\n```py\nfred = {'first_name': 'Fred', 'last_name': 'Smith'}\n\nassert_that(fred).has_first_name('Fred')\nassert_that(fred).has_last_name('Smith')\n```\n\n### Failure\n\nThe `assertpy` library includes a `fail()` method to explicitly force a test failure.  It can be used like this:\n\n```py\nfrom assertpy import assert_that,fail\n\ndef test_fail():\n    fail('forced failure')\n```\n\nA very useful test pattern that requires the `fail()` method is to verify the exact contents of an error message. For example:\n\n```py\nfrom assertpy import assert_that,fail\n\ndef test_error_msg():\n    try:\n        some_func('foo')\n        fail('should have raised error')\n    except RuntimeError as e:\n        assert_that(str(e)).is_equal_to('some err')\n```\n\nIn the above code, we invoke `some_func()` with a bad argument which raises an exception.  The exception is then handled by the `try..except` block and the exact contents of the error message are verified.  Lastly, if an exception is *not* thrown by `some_func()` as expected, we fail the test via `fail()`.\n\nThis pattern is only used when you need to verify the contents of the error message.  If you only wish to check for an expected exception (and don't need to verify the contents of the error message itself), you're much better off using a test runner that supports expected exceptions.  [Nose](http://nose.readthedocs.org/) provides a [@raises](http://nose.readthedocs.org/en/latest/testing_tools.html#nose.tools.raises) decorator. [Pytest](http://pytest.org/latest/contents.html) has a [pytest.raises](http://pytest.org/latest/assert.html#assertions-about-expected-exceptions) method.\n\n\n#### Expected Exceptions\n\nWe recommend you use your test runner to check for expected exceptions (Pytest's [pytest.raises](http://pytest.org/latest/assert.html#assertions-about-expected-exceptions) context or Nose's [@raises](http://nose.readthedocs.org/en/latest/testing_tools.html#nose.tools.raises) decorator).  In the special case of invoking a function, `assertpy` provides its own expected exception handling via a simple fluent API.\n\nGiven a function `some_func()`:\n\n```py\ndef some_func(arg):\n    raise RuntimeError('some err')\n```\n\nWe can expect a `RuntimeError` with:\n\n```py\nassert_that(some_func).raises(RuntimeError).when_called_with('foo')\n```\n\nAdditionally, the error message contents are chained, and can be further verified:\n\n```py\nassert_that(some_func).raises(RuntimeError).when_called_with('foo')\\\n    .is_length(8).starts_with('some').is_equal_to('some err')\n```\n\n\n#### Custom Error Messages\n\nSometimes you need a little more information in your failures.  For this case, `assertpy` includes a `described_as()` helper that will add a custom message when a failure occurs.  For example, if we had these failing assertions:\n\n```py\nassert_that(1+2).is_equal_to(2)\nassert_that(1+2).described_as('adding stuff').is_equal_to(2)\n```\n\nWhen run (separately, of course), they would produce these errors:\n\n```\nExpected \u003c3\u003e to be equal to \u003c2\u003e, but was not.\n[adding stuff] Expected \u003c3\u003e to be equal to \u003c2\u003e, but was not.\n```\n\nThe `described_as()` helper causes the custom message `adding stuff` to be prepended to the front of the second error.\n\n\n#### Just A Warning\n\nThere are times when you only want a warning message instead of a failing test. For example, if you are using `assertpy`\nto write defensive assertions in the normal flow of your application (not in a test).  In this case, just replace\n`assert_that` with `assert_warn`.\n\n```py\nassert_warn('foo').is_length(4)\nassert_warn('foo').is_empty()\nassert_warn('foo').is_false()\nassert_warn('foo').is_digit()\nassert_warn('123').is_alpha()\nassert_warn('foo').is_upper()\nassert_warn('FOO').is_lower()\nassert_warn('foo').is_equal_to('bar')\nassert_warn('foo').is_not_equal_to('foo')\nassert_warn('foo').is_equal_to_ignoring_case('BAR')\n```\n\nEven though all of the above assertions fail, an `AssertionError` is never raised and execution is\nnot halted.  Instead, the failed assertions merely log the following warning messages to `stdout`:\n\n```\n2019-10-27 20:00:35 WARNING [test_readme.py:423]: Expected \u003cfoo\u003e to be of length \u003c4\u003e, but was \u003c3\u003e.\n2019-10-27 20:00:35 WARNING [test_readme.py:424]: Expected \u003cfoo\u003e to be empty string, but was not.\n2019-10-27 20:00:35 WARNING [test_readme.py:425]: Expected \u003cFalse\u003e, but was not.\n2019-10-27 20:00:35 WARNING [test_readme.py:426]: Expected \u003cfoo\u003e to contain only digits, but did not.\n2019-10-27 20:00:35 WARNING [test_readme.py:427]: Expected \u003c123\u003e to contain only alphabetic chars, but did not.\n2019-10-27 20:00:35 WARNING [test_readme.py:428]: Expected \u003cfoo\u003e to contain only uppercase chars, but did not.\n2019-10-27 20:00:35 WARNING [test_readme.py:429]: Expected \u003cFOO\u003e to contain only lowercase chars, but did not.\n2019-10-27 20:00:35 WARNING [test_readme.py:430]: Expected \u003cfoo\u003e to be equal to \u003cbar\u003e, but was not.\n2019-10-27 20:00:35 WARNING [test_readme.py:431]: Expected \u003cfoo\u003e to be not equal to \u003cfoo\u003e, but was.\n2019-10-27 20:00:35 WARNING [test_readme.py:432]: Expected \u003cfoo\u003e to be case-insensitive equal to \u003cBAR\u003e, but was not.\n```\n\n##### Custom Warning Logger\n\nBy default, warnings are written to `stdout` with a formatter that includes timestamp, log level `WARNING`, and message,\nplus some stack frame magic to find the correct filename and line number where `assert_warn()` was called and failed.\nFor more control or better log formatting, you can pass in your own customer logger when you call `assert_warn()`.\n\n```py\nassert_warn('foo', logger=my_logger).is_length(4)\nassert_warn('foo', logger=my_logger).is_equal_to_ignoring_case('BAR')\n```\n\n### Soft Assertions\n\nNormally, an assertion failure will halt test execution immediately by raising an error. Soft assertions are\nway to collect assertion failures together, to be raise all at once at the end, without halting your test.  To use\nsoft assertions in `assertpy`, just use the `with soft_assertions()` context manager, like this:\n\n```py\nfrom assertpy import assert_that, soft_assertions\n\nwith soft_assertions():\n    assert_that('foo').is_length(4)\n    assert_that('foo').is_empty()\n    assert_that('foo').is_false()\n    assert_that('foo').is_digit()\n    assert_that('123').is_alpha()\n    assert_that('foo').is_upper()\n    assert_that('FOO').is_lower()\n    assert_that('foo').is_equal_to('bar')\n    assert_that('foo').is_not_equal_to('foo')\n    assert_that('foo').is_equal_to_ignoring_case('BAR')\n```\n\nAt the end of the block, all assertion failures are collected together and a single `AssertionError` is raised:\n\n```\nAssertionError: soft assertion failures:\n1. Expected \u003cfoo\u003e to be of length \u003c4\u003e, but was \u003c3\u003e.\n2. Expected \u003cfoo\u003e to be empty string, but was not.\n3. Expected \u003cFalse\u003e, but was not.\n4. Expected \u003cfoo\u003e to contain only digits, but did not.\n5. Expected \u003c123\u003e to contain only alphabetic chars, but did not.\n6. Expected \u003cfoo\u003e to contain only uppercase chars, but did not.\n7. Expected \u003cFOO\u003e to contain only lowercase chars, but did not.\n8. Expected \u003cfoo\u003e to be equal to \u003cbar\u003e, but was not.\n9. Expected \u003cfoo\u003e to be not equal to \u003cfoo\u003e, but was.\n10. Expected \u003cfoo\u003e to be case-insensitive equal to \u003cBAR\u003e, but was not.\n```\n\nAlso, note that *only* assertion failures are collected, errors such as `TypeError` or `ValueError` are raised immediately.\nTriggering an explicit test failure with `fail()` will similarly halt execution immediately.  If you need more\nforgiving behavior, you can use `soft_fail()` which is collected like any other failing assertion within a soft assertions block.\n\n### Snapshot Testing\n\nTake a snapshot of a python data structure, store it on disk in JSON format, and automatically compare the latest data to the stored data on every test run.  The snapshot testing features of `assertpy` are borrowed from [Jest](https://facebook.github.io/jest/), a well-known and powerful Javascript testing framework.  Snapshots require Python 3.\n\nFor example, snapshot the following dict:\n\n```py\nassert_that({'a':1,'b':2,'c':3}).snapshot()\n```\n\nStored on disk as the following JSON:\n\n```\n{\n  \"a\": 1,\n  \"b\": 2,\n  \"c\": 3\n}\n```\n\nAdditionally, the on-disk snapshot format supports most python data structures (dict, list, object, etc).  For example:\n\n```py\nassert_that(None).snapshot()\nassert_that(True).snapshot()\nassert_that(123).snapshot()\nassert_that(-987.654).snapshot()\nassert_that('foo').snapshot()\nassert_that([1,2,3]).snapshot()\nassert_that(set(['a','b','c'])).snapshot()\nassert_that({'a':1,'b':2,'c':3}).snapshot()\nassert_that(1 + 2j).snapshot()\nassert_that(someobj).snapshot()\n```\n\nSnapshot artifacts (typically found in the `__snapshots` folder), should be committed to source control alongside any code changes.\n\nOn the first run (when the snapshot file doesn't yet exist), the snapshot is created, stored to disk, and the test is passed.  On all subsequent runs, the given data is compared to the on-disk snapshot, and the test fails if they don't match.  Failure means that some change occured, so either a bug or a known implementation changed.\n\n#### Updating Snapshots\n\nIt's easy to update your snapshots...just delete them all and re-run the test suite to regenerate all snapshots.\n\n#### Snapshot Parameters\n\nBy default, snapshots are identified by test filename plus line number.  Alternately, you can specify a custom identifier using the `id` keyword:\n\n```py\nassert_that({'a':1,'b':2,'c':3}).snapshot(id='my-custom-id')\n```\n\nBy default, all snapshots (including those with custom identifiers) are stored in the `__snapshots` folder.  Alternately, you can specify a custom path using the `path` keyword:\n\n```py\nassert_that({'a':1,'b':2,'c':3}).snapshot(path='my-custom-folder')\n```\n\n#### Snapshot Blackbox\n\nFunctional testing (which snapshot testing falls under) is very much blackbox testing.  When something goes wrong, it's hard to pinpoint the issue, because functional tests provide little *isolation*.  On the plus side, snapshots can provide enormous *leverage* as a few well-placed snapshot tests can strongly verify an application is working that would otherwise require dozens if not hundreds of unit tests.\n\n### Extension System - adding custom assertions\n\nSometimes you want to add your own custom assertions to `assertpy`.  This can be done using the `add_extension()` helper.\n\nFor example, we can write a custom `is_5()` assertion like this:\n\n```py\nfrom assertpy import add_extension\n\ndef is_5(self):\n    if self.val != 5:\n        return self.error(f'{self.val} is NOT 5!')\n    return self\n\nadd_extension(is_5)\n```\n\nOnce registered with `assertpy`, we can use our new assertion as expected:\n\n```py\nassert_that(5).is_5()\nassert_that(6).is_5()  # fails!\n```\n\nOf course, `is_5()` is only available in the test file where `add_extension()` is called.  If you want better control of scope of your custom extensions, such as writing extensions once and using them in any test file, you'll need to use the test setup functionality of your test runner.  With [pytest](http://pytest.org/latest/contents.html), you can just use a `conftest.py` file and a _fixture_.\n\nFor example, if your `conftest.py` is:\n\n```py\nimport pytest\nfrom assertpy import add_extension\n\ndef is_5(self):\n    if self.val != 5:\n        return self.error(f'{self.val} is NOT 5!')\n    return self\n\n@pytest.fixture(scope='module')\ndef my_extensions():\n    add_extension(is_5)\n```\n\nThen in any test method in any test file (like `test_foo.py` for example), you just pass in the fixture and all of your extensions are available, like this:\n\n```py\nfrom assertpy import assert_that\n\ndef test_foo(my_extensions):\n    assert_that(5).is_5()\n    assert_that(6).is_5()  # fails!\n```\n\nwhere the `my_extensions` parameter must be the name of your fixture function in `conftest.py`.  See the [fixture docs](https://docs.pytest.org/en/latest/fixture.html) for details.\n\n#### Writing custom assertions\n\nHere are some useful tips to help you write your own custom assertions:\n\n1. Use `self` as first param (as if your function was an instance method).\n2. Use `self.val` to get the _actual_ value to be tested.\n3. It's better to test the negative, and then fail if true.\n4. Fail by raising an `AssertionError` (the `self.error()` helper does this for you).\n5. Always use the `self.error()` helper to fail (and print your failure message).\n6. Always `return self` to allow for chaining.\n\nPutting it all together, here is another custom assertion example, but annotated with comments:\n\n```py\ndef is_multiple_of(self, other):\n    # validate actual value - must be \"integer\" (aka int or long)\n    if isinstance(self.val, numbers.Integral) is False or self.val \u003c= 0:\n        # bad input is error, not an assertion fail, so raise error\n        raise TypeError('val must be a positive integer')\n\n    # validate expected value\n    if isinstance(other, numbers.Integral) is False or other \u003c= 0:\n        raise TypeError('given arg must be a positive integer')\n\n    # calc remainder using divmod() built-in\n    _, rem = divmod(self.val, other)\n\n    # test the negative (is remainder non-zero?)\n    if rem \u003e 0:\n        # non-zero remainder, so not multiple -\u003e we fail!\n        return self.error('Expected \u003c%s\u003e to be multiple of \u003c%s\u003e, but was not.' % (self.val, other))\n\n    # success, and return self to allow chaining\n    return self\n```\n\n### Chaining\n\nOne of the nicest aspects of any fluent API is the ability to chain methods together.  In the case of `assertpy`, chaining\nallows you to write assertions as single statement -- that reads like a sentence, and is easy to understand.\n\nHere are just a few examples:\n\n```py\nassert_that('foo').is_length(3).starts_with('f').ends_with('oo')\n\nassert_that([1,2,3]).is_type_of(list).contains(1,2).does_not_contain(4,5)\n\nassert_that(fred).has_first_name('Fred').has_last_name('Smith').has_shoe_size(12)\n\nassert_that(people).is_length(2).extracting('first_name').contains('Fred','Joe')\n```\n\n\n## Future\n\nThere are always a few new features in the works...if you'd like to help, check out the [open issues](https://github.com/assertpy/assertpy/issues) and see our [Contributing](CONTRIBUTING.md) doc.\n\n\n## License\n\nAll files are licensed under the BSD 3-Clause License as follows:\n\n\u003e Copyright (c) 2015-2019, Activision Publishing, Inc.\n\u003e All rights reserved.\n\u003e\n\u003e Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\u003e\n\u003e 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\u003e\n\u003e 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\u003e\n\u003e 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\u003e\n\u003e THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","funding_links":[],"categories":["Topics Index"],"sub_categories":["Unit Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertpy%2Fassertpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassertpy%2Fassertpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertpy%2Fassertpy/lists"}