{"id":18257898,"url":"https://github.com/linkdd/unittest2canopsis","last_synced_at":"2025-04-08T22:46:46.964Z","repository":{"id":24408788,"uuid":"27809408","full_name":"linkdd/unittest2canopsis","owner":"linkdd","description":"Canopsis Connector which generate events from unittest","archived":false,"fork":false,"pushed_at":"2015-02-07T22:11:35.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T10:31:51.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/linkdd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-10T08:24:45.000Z","updated_at":"2015-02-07T22:11:35.000Z","dependencies_parsed_at":"2022-08-22T23:40:19.796Z","dependency_job_id":null,"html_url":"https://github.com/linkdd/unittest2canopsis","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Funittest2canopsis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Funittest2canopsis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Funittest2canopsis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Funittest2canopsis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdd","download_url":"https://codeload.github.com/linkdd/unittest2canopsis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941719,"owners_count":21022037,"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-11-05T10:28:06.406Z","updated_at":"2025-04-08T22:46:46.949Z","avatar_url":"https://github.com/linkdd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"UnitTest to Canopsis connector\n=========================\n\n.. image:: https://travis-ci.org/linkdd/unittest2canopsis.svg?branch=master\n\n\nThis package provides a connector which will executes Python unittest to generate\nevents for Canopsis.\n\nUsage\n-----\n\nIn this example, we will use the following test (as ``mytest.py``):\n\n.. code-block:: python\n\n   # -*- coding: utf-8 -*-\n\n   import unittest\n\n\n   class MyTestCase(unittest.TestCase):\n       def test_success(self):\n           self.assertTrue(True)\n\n       def test_fail(self):\n           self.assertFalse(True)\n\n\n   if __name__ == '__main__':\n       unittest.main()\n\nRun the unittest on :\n\n.. code-block::\n\n   $ unittest2canopsis -t mytest.py -n mytest0 -a \"amqp://guest:guest@localhost:5672/\"\n   unittest.mytest0.check.resource.MyTestCase.test_fail... FAIL\n   unittest.mytest0.check.resource.MyTestCase.test_success... OK\n\nYou can also use a JSON configuration file :\n\n.. code-block:: javascript\n\n   {\"tcp2canopsis\": {\n       \"test\": \"mytest.py\",\n       \"testname\": \"mytest0\",\n       \"amqp\": \"amqp://guest:guest@localhost:5672/\"\n   }}\n\nAnd load the file using :\n\n.. code-block::\n\n   $ unittest2canopsis -c path/to/config.json\n\nExample of generated events :\n\n.. code-block:: javascript\n\n   {\n     \"timestamp\": 1418206046,\n     \"connector\": \"unittest\",\n     \"connector_name\": \"mytest0\",\n     \"event_type\": \"check\",\n     \"source_type\": \"resource\",\n     \"component\": \"MyTestCase\",\n     \"resource\": \"test_fail\",\n     \"state\": 2,\n     \"state_type\": 1,\n     \"output\": \"Traceback (most recent call last):\\n  File \\\"mytest.py\\\", line 11, in test_fail\\n    self.assertFalse(True)\\nAssertionError: True is not false\\n\"\n   }\n   {\n     \"timestamp\": 1418206046,\n     \"connector\": \"unittest\",\n     \"connector_name\": \"mytest0\",\n     \"event_type\": \"check\",\n     \"source_type\": \"resource\",\n     \"component\": \"MyTestCase\",\n     \"resource\": \"test_success\",\n     \"state\": 0,\n     \"state_type\": 1,\n     \"output\": \"OK\"\n   }\n\nInstallation\n------------\n\nJust type :\n\n.. code-block::\n\n   $ pip install unittest2canopsis\n\nOr, to install it in a locally :\n\n.. code-block::\n\n   $ ./makefile\n\nThis will create a virtual Python environment in the current folder, and install the dependencies listed by ``requirements.txt``.\nFinally, it will perform a ``python setup.py install``.\n\nAfter executing this script, the connector will be available in the current folder (which is now a virtual Python environment).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Funittest2canopsis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdd%2Funittest2canopsis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Funittest2canopsis/lists"}