{"id":20962161,"url":"https://github.com/haarcuba/testix","last_synced_at":"2025-08-16T23:06:08.767Z","repository":{"id":22787186,"uuid":"26133386","full_name":"haarcuba/testix","owner":"haarcuba","description":"Mocking framework for Python with *exact* Scenarios","archived":false,"fork":false,"pushed_at":"2025-06-03T09:44:13.000Z","size":455,"stargazers_count":7,"open_issues_count":10,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T06:51:22.862Z","etag":null,"topics":["mock","mocking-framework","python","unit-testing","unittest"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/haarcuba.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2014-11-03T18:52:46.000Z","updated_at":"2025-06-03T09:43:19.000Z","dependencies_parsed_at":"2024-02-28T17:43:43.709Z","dependency_job_id":"dd056611-f68c-44a1-89b8-fa1359f84b23","html_url":"https://github.com/haarcuba/testix","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/haarcuba/testix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haarcuba%2Ftestix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haarcuba%2Ftestix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haarcuba%2Ftestix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haarcuba%2Ftestix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haarcuba","download_url":"https://codeload.github.com/haarcuba/testix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haarcuba%2Ftestix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270781393,"owners_count":24643820,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mock","mocking-framework","python","unit-testing","unittest"],"created_at":"2024-11-19T02:23:39.405Z","updated_at":"2025-08-16T23:06:08.745Z","avatar_url":"https://github.com/haarcuba.png","language":"Vim Script","readme":"# TESTIX\n\nTestix is a Mocking framework for Python, meant to be used with [pytest](https://docs.pytest.org/en/latest/).\n\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n[![GitHub release](version.svg)](https://GitHub.com/haarcuba/testix/releases/)\n\n\nTestix is special because it allows you to specify what your mock objects do,\nand it then enforces your specifications automatically. It also reduces (albeit\nnot entirely) mock setup. Other frameworks usually have a flow like this:\n\n* setup mock\n* let code do something with mock\n* assert mock used in correct way\n\nTestix flow is a bit different\n* setup mock objects (`sock` in the following example)\n* specify exactly what should happen to them using a Scenario context\n\n\n# TOC\n\n* [Documentation](#documentation)\n* [Small Example](#small-example)\n* [Installation](#installation)\n* [Python 3 and Legacy Python](#legacy)\n* [Advanced Features](#advanced-features)\n\n\n## Documentation \u003ca name=\"documentation\"\u003e\u003c/a\u003e\n\nRead the full docs at [readthedocs](https://testix.readthedocs.io/en/latest/)\n\n## Small Example \u003ca name=\"small-example\"\u003e\u003c/a\u003e\nHere's a small example:\n\n```python\n    # create your object under test, pass in some mock objects\n    # in production, Chatbot will receive and actual socket object\n    # here we want to test what it does with the socket it receives\n    # and we do not want it to actually communicate with anyone\n    # to both those ends, we pass a mock, or fake, object.\n    self.tested = chatbot.Chatbot(Fake('sock')) # Fake('sock') is a mock object named \"sock\"\n\n    # create a Scenario context\n    # inside, you specify exactly what the unit should do with the objects its handed\n    with Scenario() as s:\n\n        # we can refer here to s.sock, because there is a mock named `sock`\n        s.sock.recv(4096) \u003e\u003e 'request text'  # unit must call sock.recv(4096).\n                                             # this call will return 'request text'\n        s.sock.send('response text')\n\n        # call your unit's code\n        self.tested.go()\n\n\n# Scenario context ends, and verifies everything happened exactly as specified\n# No more, no less\n```\n\nNote that you do not have to setup `sock.recv` or `sock.send` - once `sock` is\nset up, it will generate other mock objects automatically as you go along with\nit. Only \"top level\" mock objects need to be setup explicitly.\n\nContinue reading for further examples.\n\n\n## Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\nWith `pip`:\n\n    $ pip install testix\n\n## Python 3 and Legacy Python (Python 2) \u003ca name=\"legacy\"\u003e\u003c/a\u003e\n\nTestix works with Python 3. It will not work with legacy python.\n\n\n### Credit Where it's due\nTestix started as a re-implementation of ideas from the [Voodoo-Mock](http://sourceforge.net/projects/voodoo-mock)\nunit-testing framework. Since then it has evolved some different traits though.\n\n### License\n\nThis software is available under the MIT License, see the `LICENSE` file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaarcuba%2Ftestix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaarcuba%2Ftestix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaarcuba%2Ftestix/lists"}