{ "info": { "author": "Wolfgang Schnerring , Michael Howitz ", "author_email": "mail@gocept.com", "bugtrack_url": null, "classifiers": [], "description": "==============\ngocept.exttest\n==============\n\nRuns tests provided by an external command from Python's ``unittest.TestCase``.\n\n.. contents:: :depth: 1\n\n\nUsage\n=====\n\ngocept.exttest provides one public function, ``makeSuite``, which returns a\n``unittest.TestSuite`` and takes a single argument: the name of the external\nbinary to run. (Any additional arguments will be passed to the external command\nas command-line parameters.)\n\nHere's a simple example::\n\n import gocept.exttest\n def test_suite():\n return gocept.exttest.makeSuite(\n 'bin/external_test_runner', '--some-arg', '--another-arg')\n\n``makeSuite`` calls the external command to ask for a list of test cases and\ntest functions (see below for the exact protocol), and returns a ``TestSuite``\nof ``TestCase`` objects that contain corresponding test methods. Each test\nmethod will call the external command to run its test, and converts the results\nreturned by the external command to the conventions of the ``unittest`` module\n(e.g. raises ``AssertionError`` for failed tests, etc.).\n\n\nRequirements\n============\n\nThe external command needs to understand two command line parameters:\n``--list`` and ``--run ``:\n\n``--list`` must return a list of available test cases and test functions\nformatted as JSON::\n\n $ bin/external_test_runner --list\n [{\"case\": \"MyExternalTestCase\",\n \"tests\": [\"test_one\", \"test_two\"]}\n\n``--run`` is used to run one specific test, returning the results formatted as\nJSON::\n\n $ bin/external_test_runner --run MyExternalTestCase.test_two\n [{\"name\": \"MyExternalTestCase.test_two\",\n \"status\": \"FAIL\",\n \"message\": \"Test failed.\",\n \"traceback\": \"...\"}]\n\nNOTE: The custom JSON format for test results was chosen for simplicity when\nintegrating with JavaScript (see below); we'll have to evaluate whether the\ncommonly used XML format from `JUnitReport`_ could be used instead.\n\n.. _`JUnitReport`: http://ant.apache.org/manual/Tasks/junitreport.html\n\nIf neither ``--list`` nor ``--run`` is given, the external command should run\nall tests::\n\n $ bin/external_test_runner\n [{\"name\": \"MyExternalTestCase.test_one\",\n \"status\": \"SUCCESS\",\n \"message\": \"Test passed.\"},\n {\"name\": \"MyExternalTestCase.test_two\",\n \"status\": \"FAIL\",\n \"message\": \"Test failed.\",\n \"traceback\": \"...\"}]\n\n\nExample: JavaScript\n===================\n\nRunning tests\n-------------\n\nWe built gocept.exttest to integrate javascript unittests with python\nunittests. We've decided to use `Jasmine`_ as the javascript unittest\nframework, running under node.js via `jasmine-node`_. (In order to use jasmine\nwith gocept.exttest, we extended jasmine-node to support the ``--list`` /\n``-run`` arguments and the JSON output format.)\n\n.. _`Jasmine`: http://pivotal.github.com/jasmine/\n.. _`jasmine-node`: https://github.com/mhevery/jasmine-node\n\nIn your buildout environment, install node.js and jasmine-node like this::\n\n [buildout]\n parts =\n nodejs\n test\n\n [nodejs]\n recipe = gp.recipe.node\n npms = ${buildout:directory}/../jasmine-node\n scripts = jasmine-node\n\n [test]\n recipe = zc.recipe.testrunner\n eggs = your.package\n environment = env\n\n [env]\n jasmine-bin = ${buildout:directory}/bin/jasmine-node\n\nYou need to checkout the jasmine-node fork from\nhttps://github.com/wosc/jasmine-node until the changes are merged upstream. (In\nthe example, ``${buildout:directory}/../jasmine-node`` is used for its\nlocation.)\n\nWriting tests\n-------------\n\nFor example, let's say the javascript tests should reside in\n``your.package.tests``. `jasmine-node` supports tests written in both\nJavaScript and CoffeeScript (by specifying the ``--coffee`` command-line\nparameter), and requires test files to have ``_spec`` in their name.\n\nAn example test might look like this (please refer to the `Jasmine\ndocumentation`_ for details) ::\n\n require 'my_app.js'\n\n describe 'MyApp', ->\n it 'has read Douglas Adams', ->\n expect(new MyApp().calculate_the_answer()).toEqual(42)\n\nThen wire up the tests as follows (the path to the external command is passed\nto the tests via an environment variable)::\n\n import gocept.exttest\n def test_suite():\n return gocept.exttest.makeSuite(\n os.environ.get('jasmine-bin'),\n '--coffee',\n '--json',\n pkg_resources.resource_filename('your.package', 'tests'))\n\n\n.. _`Jasmine documentation`: http://github.com/pivotal/jasmine/wiki\n\n\nDevelopment\n===========\n\nThe source code is available in the mercurial repository at\nhttps://code.gocept.com/hg/public/gocept.exttest\n\nPlease report any bugs you find at\nhttps://projects.gocept.com/projects/gocept-exttest/issues\n\n\nChangelog\n=========\n\n\n1.1 (unreleased)\n----------------\n\n- Nothing changed yet.\n\n\n1.0 (2012-01-24)\n----------------\n\n- Reworked documentation.\n\n\n0.1.4 (2012-01-20)\n------------------\n\n- Package description.\n\n\n0.1.3 (2012-01-20)\n------------------\n\n- Improved the docs.\n\n\n0.1.2 (2012-01-19)\n------------------\n\n- Repair broken release (again).\n\n\n0.1.1 (2012-01-19)\n------------------\n\n- Repair broken release (0.1).\n\n\n0.1 (2012-01-19)\n----------------\n\n- first release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.gocept.com/hg/public/gocept.exttest", "keywords": null, "license": "ZPL", "maintainer": null, "maintainer_email": null, "name": "gocept.exttest", "package_url": "https://pypi.org/project/gocept.exttest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gocept.exttest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://code.gocept.com/hg/public/gocept.exttest" }, "release_url": "https://pypi.org/project/gocept.exttest/1.0/", "requires_dist": null, "requires_python": null, "summary": "Helper to integrate external tests with python unittests.", "version": "1.0" }, "last_serial": 792553, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5d83f0cb2e1e7b0f8f6f2c1e6985a1ff", "sha256": "f118e7fe0c6b3f98179706b4ae82157c8f61d16735b9c37905a5f1bdb4b96d64" }, "downloads": -1, "filename": "gocept.exttest-0.1.tar.gz", "has_sig": false, "md5_digest": "5d83f0cb2e1e7b0f8f6f2c1e6985a1ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4124, "upload_time": "2012-01-19T09:38:02", "url": "https://files.pythonhosted.org/packages/36/e6/44cdc09d1cf3791e55094d744e6b24e2abaf286519a512d7d916bc7dc37a/gocept.exttest-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e02e9dbbd81ff24e58eda9ea543043d7", "sha256": "f4a3fc0f2650ca7cb3e97b35772e14575aae09442c047a20a5f4de8a79f9e0ba" }, "downloads": -1, "filename": "gocept.exttest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e02e9dbbd81ff24e58eda9ea543043d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4147, "upload_time": "2012-01-19T10:20:23", "url": "https://files.pythonhosted.org/packages/6d/7b/26773871e19d7428cfb3d865fc8a010e500e8eb4b6f79644d3f3822774fa/gocept.exttest-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "bf8ca344e37cb873efac700a6a6a08b3", "sha256": "5aece87d69aa5a3d898e16727c03b52c0f31c8da4d7e7876b6a87ef1760f8c2c" }, "downloads": -1, "filename": "gocept.exttest-0.1.2.tar.gz", "has_sig": false, "md5_digest": "bf8ca344e37cb873efac700a6a6a08b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6903, "upload_time": "2012-01-19T10:26:16", "url": "https://files.pythonhosted.org/packages/09/19/b5c11a4770f850bbe658d9b33a565d2da66f37985f200d8a09c24a0f4fb7/gocept.exttest-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2cf05f9e9f3cfb0527f0099339589e93", "sha256": "17d8b9aa4e8ded15805eb9f418611fd45c6cf80639593ff568ffd89029f8c226" }, "downloads": -1, "filename": "gocept.exttest-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2cf05f9e9f3cfb0527f0099339589e93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6956, "upload_time": "2012-01-20T09:18:10", "url": "https://files.pythonhosted.org/packages/a6/7c/b07f955c68a2a98a6a44c7c265a268dbf6b195a7362c207091d0fad11689/gocept.exttest-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8e10629f09b6998829aa63e0a332ee83", "sha256": "0f220fcac6bb0006af5e326f0c4df87124a29c60916c35713c8bf432ce67d141" }, "downloads": -1, "filename": "gocept.exttest-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8e10629f09b6998829aa63e0a332ee83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7010, "upload_time": "2012-01-20T09:20:33", "url": "https://files.pythonhosted.org/packages/de/c9/b132d12999edf2018bbf1192c40fab00fbdd961a48f2e3cb623bfb25125a/gocept.exttest-0.1.4.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "f0e99d93a0d0eb1ce69844d7b3434756", "sha256": "c6853ae3241a52174323377c71f252522b7d1dce680d767edbfc780c7627e862" }, "downloads": -1, "filename": "gocept.exttest-1.0.tar.gz", "has_sig": false, "md5_digest": "f0e99d93a0d0eb1ce69844d7b3434756", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7768, "upload_time": "2012-01-24T08:43:37", "url": "https://files.pythonhosted.org/packages/dc/75/449d8b549c07db227c9c6e09b6814aae2b88148593c70dcb93ccaaa5744f/gocept.exttest-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0e99d93a0d0eb1ce69844d7b3434756", "sha256": "c6853ae3241a52174323377c71f252522b7d1dce680d767edbfc780c7627e862" }, "downloads": -1, "filename": "gocept.exttest-1.0.tar.gz", "has_sig": false, "md5_digest": "f0e99d93a0d0eb1ce69844d7b3434756", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7768, "upload_time": "2012-01-24T08:43:37", "url": "https://files.pythonhosted.org/packages/dc/75/449d8b549c07db227c9c6e09b6814aae2b88148593c70dcb93ccaaa5744f/gocept.exttest-1.0.tar.gz" } ] }