{ "info": { "author": "Thomas Reifenberger", "author_email": "tom-mi at rfnbrgr.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: System :: Monitoring" ], "description": "python-pytest-check\\_mk\n=======================\n\n|Build Status|\n\nPlugin for `py.test `__ to test\n`Check\\_MK `__ checks.\n\nUsage\n-----\n\nThe following example contains a test suite for the ``foobar`` check\ncontained in the Check\\_MK installation (see\n``share/doc/check_mk/skeleton_check``). The check file needs to be named\nafter its agent section, i.e. ``foobar``.\n\nDirectory layout\n~~~~~~~~~~~~~~~~\n\n::\n\n \u251c\u2500\u2500 agents\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 plugins\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 foobar_linux\n \u251c\u2500\u2500 checks\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 foobar\n \u2514\u2500\u2500 test\n \u2514\u2500\u2500 test_foobar.py\n\nTest agent\n~~~~~~~~~~\n\nAll executable files in the ``agents`` directory can be executed with\nthe ``agents`` fixture:\n\n::\n\n def test_agent_plugin(agent):\n assert agents['plugins/foobar_linux'].run() == '<<>>\\nFOO BAR\\n'\n\nIt is also possible to pass commandline arguments to the agent or agent\nplugin:\n\n::\n\n def test_fritzbox_agent(agents):\n assert '<<>>' in agents['special/agent_fritzbox'].run('--timeout', '20', 'fritz.box')\n\nTest check\n~~~~~~~~~~\n\nWithin a single test file one check file can be tested. The name of the\ncheck file is set with the ``test_for`` module-level variable.\n\n::\n\n from pytest_check_mk import OK, WARNING, CRITICAL, UNKNOWN\n\n\n test_for = 'foobar'\n\n\n sample_plugin_output = '''\n <<>>\n FOO BAR\n '''\n\n\n def test_inventory(checks):\n assert checks['foobar'].inventory(sample_plugin_output) == []\n\n\n def test_check(checks):\n item = None\n params = None\n assert checks['foobar'].check(item, params, sample_plugin_output) == (UNKNOWN, 'UNKNOWN - Check not implemented')\n\n\n def test_settings(checks):\n assert checks['foobar'].service_description == 'FOOBAR'\n assert not checks['foobar'].has_perfdata\n\nTest check with agent data\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThere is a sort of 'ensure everything works together' assertion. It\ncalls both inventory and check function with a given agent output and\nchecks that the return values match the expected format.\n\n::\n\n from pytest_check_mk.assertions import assert_inventory_and_check_works_with_check_output\n\n\n test_for = 'foobar'\n\n\n def test_check_with_agent_output(agent, checks):\n output = agents['plugins/foobar_linux'].run()\n assert_inventory_and_check_works_with_check_output(checks['foobar'], output)\n\nLicense\n-------\n\nThis software is licensed under GPLv2.\n\n.. |Build Status| image:: https://travis-ci.org/tom-mi/python-pytest-check_mk.svg?branch=master\n :target: https://travis-ci.org/tom-mi/python-pytest-check_mk", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tom-mi/python-pytest-check_mk/", "keywords": "", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "pytest-check-mk", "package_url": "https://pypi.org/project/pytest-check-mk/", "platform": "any", "project_url": "https://pypi.org/project/pytest-check-mk/", "project_urls": { "Homepage": "https://github.com/tom-mi/python-pytest-check_mk/" }, "release_url": "https://pypi.org/project/pytest-check-mk/0.1.1/", "requires_dist": [ "pytest" ], "requires_python": "", "summary": "pytest plugin to test Check_MK checks", "version": "0.1.1" }, "last_serial": 1824969, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "69c375e250dc80939460022320def159", "sha256": "224bcbd228616422d92352251226c69cc4f88355197266e25504d1ea2f137fb8" }, "downloads": -1, "filename": "pytest_check_mk-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69c375e250dc80939460022320def159", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8892, "upload_time": "2015-11-19T20:41:10", "url": "https://files.pythonhosted.org/packages/ea/05/2482c57c722caea8b65bf3ebc019527a4d0e0ff714f03b3a54b2ac82f37b/pytest_check_mk-0.1-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b612d4d7987f2e0c0952a7d43c43aed7", "sha256": "e8fc09a79cb3129adef68edab20cf01a2ce22614a8a2cadb671e5b69aa281507" }, "downloads": -1, "filename": "pytest_check_mk-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b612d4d7987f2e0c0952a7d43c43aed7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8924, "upload_time": "2015-11-19T20:57:41", "url": "https://files.pythonhosted.org/packages/2c/50/90765e135ff55a6ffad50309992d643d8e3c7307e8013469a20d6a33788b/pytest_check_mk-0.1.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b612d4d7987f2e0c0952a7d43c43aed7", "sha256": "e8fc09a79cb3129adef68edab20cf01a2ce22614a8a2cadb671e5b69aa281507" }, "downloads": -1, "filename": "pytest_check_mk-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b612d4d7987f2e0c0952a7d43c43aed7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8924, "upload_time": "2015-11-19T20:57:41", "url": "https://files.pythonhosted.org/packages/2c/50/90765e135ff55a6ffad50309992d643d8e3c7307e8013469a20d6a33788b/pytest_check_mk-0.1.1-py2.py3-none-any.whl" } ] }