{ "info": { "author": "Todd Wolfson", "author_email": "todd@twolfson.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: Public Domain", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Testing", "Topic :: Text Editors" ], "description": "sublime-plugin-tests-base\n=========================\n\n.. image:: https://travis-ci.org/twolfson/sublime-plugin-tests-base.png?branch=master\n :target: https://travis-ci.org/twolfson/sublime-plugin-tests-base\n :alt: Build Status\n\nBase layer for testing and assertion frameworks against `Sublime Text`_\n\nThis is part of the `sublime-plugin-tests`_ project, a full testing framework for `Sublime Text`_\n\n.. _`sublime-plugin-tests`: https://github.com/twolfson/sublime-plugin-tests\n.. _`Sublime Text`: http://sublimetext.com/\n\nFor supported versions and FAQs, please consult `sublime-plugin-tests`_.\n\nDeprecation notice\n==================\nWe have decided to deprecate ``sublime-plugin-tests-base`` in favor of `randy3k/UnitTesting`_.\n\nIt has greater platform support and a less brittle design for local development.\n\nhttps://github.com/randy3k/UnitTesting\n\n.. _`randy3k/UnitTesting`: https://github.com/randy3k/UnitTesting\n\nGetting Started\n---------------\nInstall the module with: ``pip install sublime_plugin_tests_base``\n\nThen, write your tests:\n\n.. code:: python\n\n # Load in unittest and test base\n from unittest import TestCase\n from sublime_plugin_tests_base import Base\n\n # Define a TestCase\n class TestLeftDelete(TestCase):\n def test_left_delete_single(self):\n # Each test function *must* return Python with a `run` function\n # `run` will be run inside Sublime Text. Perform your assertions etc there.\n # Run a test\n base = Base()\n result = base.run_test(\"\"\"\n # Use ScratchView utility provided by `sublime_plugin_tests`\n from utils.scratch_view import ScratchView\n\n def run():\n # Generate new scratch file\n scratch_view = ScratchView()\n try:\n # Update the content and selection `ab|c`\n scratch_view.set_content('abc')\n scratch_view.set_sel([(2, 2)])\n\n # Delete one character to the left `a|c\n scratch_view.run_command('left_delete')\n\n # Assert the current content\n assert scratch_view.get_content() == 'ac'\n finally:\n # No matter what happens, close the view\n scratch_view.destroy()\n \"\"\")\n\n # Assert the test passed as expected\n self.assertEqual(result['success'], True)\n\n.. code:: bash\n\n $ # Run tests via nosetests\n $ nosetests\n .\n ----------------------------------------------------------------------\n Ran 1 test in 0.076s\n\n OK\n\nTravis CI integration\n^^^^^^^^^^^^^^^^^^^^^\nWe support both Sublime Text 2 and 3 via Travis CI.\n\nPlease consult `sublime-plugin-tests#travis-ci-integration`_ for the most up-to-date information.\n\n.. _`sublime-plugin-tests#travis-ci-integration`: https://github.com/twolfson/sublime-plugin-tests#travis-ci-integration\n\nDocumentation\n-------------\n``sublime-plugin-tests-base`` consists of two pieces: test framework code (outside Sublime Text) and test helpers (inside Sublime Text).\n\nThe test framework code is run in your normal development environment (e.g. where ``nosetests`` lives). The test helpers live inside of Sublime text to make your testing life easier.\n\nTest framework\n^^^^^^^^^^^^^^\nBase(auto_kill_sublime=False)\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nClass for running enclosed tests inside of Sublime. It handles capturing and returning errors.\n\n- auto_kill_sublime ``Boolean`` - If true, this will close Sublime Text automatically when the test completes.\n - This is useful for headless environments which are using a synchronous Sublime Text (e.g. Sublime Text 2)\n\nbase.directory\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nFolder where tests are run. This can be used for writing relatively imported files.\n\nrun_test(action_str)\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nRun code within the context of Sublime Text. This will capture any **synchronous** errors that occur. To clarify, if you use ``sublime.set_timeout``, we cannot report back the error.\n\n- action_str ``String`` - Code to run within the context of Sublime Text. This should be making assertions against views as the data will not be available in the ``result``.\n\n**Returns:**\n\n- result ``Dictionary`` - Container for results\n - success ``Boolean`` - If there were no errors, ``True``. Otherwise, ``False``.\n - meta_info ``String`` - Formatted traceback from the error that occurred.\n\nTest helpers\n^^^^^^^^^^^^\nutils.scratch_view.ScratchView\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\nThis assists with creating/tearing down/manipulating views.\n\nPlease consult `sublime-plugin-tests#utilsscratch_viewscratchview`_ for the most up-to-date information.\n\n.. _`sublime-plugin-tests#utilsscratch_viewscratchview`: https://github.com/twolfson/sublime-plugin-tests#utilsscratch_viewscratchview\n\nArchitecture\n------------\nPlease consult `sublime-plugin-tests#architecture`_ for the most up-to-date information.\n\n.. _`sublime-plugin-tests#architecture`: https://github.com/twolfson/sublime-plugin-tests#architecture\n\nContributing\n------------\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test via ``./test.sh``.\n\nIf you would like to headlessly run the tests, this repository can be used with `Vagrant`_.\n\n..\n\n Currently, it is only configured for Sublime Text 3.\n\n.. _Vagrant: http://vagrantup.com/\n\n.. code:: bash\n\n $ vagrant up\n [default] Importing base box 'precise64'...\n ...\n $ vagrant ssh st2 # Sublime Text 3\n $ # Use `st3` for Sublime Text 2\n vagrant@precise64:~$ cd /vagrant\n vagrant@precise64:/vagrant$ ./test.sh\n ..\n ----------------------------------------------------------------------\n Ran 2 tests in 2.957s\n\n OK\n\nDonating\n--------\nSupport this project and `others by twolfson`_ via `gittip`_.\n\n.. image:: https://rawgithub.com/twolfson/gittip-badge/master/dist/gittip.png\n :target: `gittip`_\n :alt: Support via Gittip\n\n.. _`others by twolfson`:\n.. _gittip: https://www.gittip.com/twolfson/\n\nUnlicense\n---------\nAs of Dec 23 2013, Todd Wolfson has released this repository and its contents to the public domain.\n\nIt has been released under the `UNLICENSE`_.\n\n.. _UNLICENSE: https://github.com/twolfson/sublime-plugin-tests-base/blob/master/UNLICENSE", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/twolfson/sublime-plugin-tests-base/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/twolfson/sublime-plugin-tests-base", "keywords": "sublime,plugin,test,assert", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "sublime_plugin_tests_base", "package_url": "https://pypi.org/project/sublime_plugin_tests_base/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sublime_plugin_tests_base/", "project_urls": { "Download": "https://github.com/twolfson/sublime-plugin-tests-base/archive/master.zip", "Homepage": "https://github.com/twolfson/sublime-plugin-tests-base" }, "release_url": "https://pypi.org/project/sublime_plugin_tests_base/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Base layer for testing and assertion frameworks against Sublime Text", "version": "1.0.0" }, "last_serial": 1881954, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "75aa54b6d8a8c0e20d426df573a5e19f", "sha256": "c49ac808d257b9b7839a2a3314444ccf7a968a82399e4a5d871bee647405ddcf" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.0.tar.gz", "has_sig": false, "md5_digest": "75aa54b6d8a8c0e20d426df573a5e19f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13474, "upload_time": "2013-12-25T06:36:07", "url": "https://files.pythonhosted.org/packages/ff/b2/2a74839e91aa9fef4aedc017d1953b343dbf2b14723d87fe70d1de87ff97/sublime_plugin_tests_base-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "d0ca4f7270293f6bd7a44418bb6cce08", "sha256": "9a4d8e6ae5e0c40dca9587bcc116f156d27d4d04d9737dd2e5219c6210e198fa" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.0.zip", "has_sig": false, "md5_digest": "d0ca4f7270293f6bd7a44418bb6cce08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22847, "upload_time": "2013-12-25T06:36:09", "url": "https://files.pythonhosted.org/packages/74/3d/22ac2ab36299557620f9d2b74ae44f6d91a2528299104fa3acacc526e85e/sublime_plugin_tests_base-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "bfa9349ea3ef2345482f1478692bc996", "sha256": "81ecbc204aa22293d9e3b3c4fd8304e731dbd6d02744da0d73d55cf725efd04d" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bfa9349ea3ef2345482f1478692bc996", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13580, "upload_time": "2014-02-26T08:47:18", "url": "https://files.pythonhosted.org/packages/b9/dd/6c6900d8abcd38a8e05cc8a25ae163dec000ad7257b78a4128de6bdf48aa/sublime_plugin_tests_base-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "8dd1d666939e058248eb0320a12d1f52", "sha256": "6020ab5c7c42cb186cb53e00f2785c9b1eb030c60ca8d48976ae4e025c7794b5" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.1.zip", "has_sig": false, "md5_digest": "8dd1d666939e058248eb0320a12d1f52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22927, "upload_time": "2014-02-26T08:47:20", "url": "https://files.pythonhosted.org/packages/8e/3f/6ad49997e1135371999eb79f6aff8a0a1609eb710b8ca1e50a8d79ebcdb5/sublime_plugin_tests_base-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "692b2c213e51cf74b8900a1658492e89", "sha256": "093cae90d7982d138b28d9d5d6dc35ce1d4873b0151c369f8de4456c7b7f51b5" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.2.tar.gz", "has_sig": false, "md5_digest": "692b2c213e51cf74b8900a1658492e89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9563, "upload_time": "2015-12-30T03:39:45", "url": "https://files.pythonhosted.org/packages/af/8c/ad9264bb9223470fd45dd62a305c13b07fa69181cdc049cf94df431b54ee/sublime_plugin_tests_base-0.1.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "688596e0934e9cbd39dad93790b6bb6e", "sha256": "c31d6b679754c1ec6f2126a1b2112646f2d4b9655de3391440b66f0ba4432965" }, "downloads": -1, "filename": "sublime_plugin_tests_base-0.1.2.zip", "has_sig": false, "md5_digest": "688596e0934e9cbd39dad93790b6bb6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20072, "upload_time": "2015-12-30T03:39:50", "url": "https://files.pythonhosted.org/packages/40/d6/f0cb9d6f8133908ff3d7a6d614f249872efd493dec92761c51030e55fe4f/sublime_plugin_tests_base-0.1.2.zip" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "21a08f9fad431a3fba32504ae184a7b7", "sha256": "8d2cfabd4d3f8b7777904f4475ff220035ecf04398b01be4f548af93cdac0f32" }, "downloads": -1, "filename": "sublime_plugin_tests_base-1.0.0.tar.gz", "has_sig": false, "md5_digest": "21a08f9fad431a3fba32504ae184a7b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9704, "upload_time": "2015-12-30T03:41:52", "url": "https://files.pythonhosted.org/packages/d5/7b/01f8c1fb2a7cb31a6cd336b48558dda8874d6298a7b03a77a59867485e7a/sublime_plugin_tests_base-1.0.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "33b65bc0c1fd8d00c13e48941fa24a12", "sha256": "95378ff9287884ac99fb3c7fb944f13e467c55efb9a691907148c53c5b654b07" }, "downloads": -1, "filename": "sublime_plugin_tests_base-1.0.0.zip", "has_sig": false, "md5_digest": "33b65bc0c1fd8d00c13e48941fa24a12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20395, "upload_time": "2015-12-30T03:41:57", "url": "https://files.pythonhosted.org/packages/64/66/7f7f2901ab343afaeb6db5c2d9ee5c4f72e5d5b44b17ee5ddf776a136acd/sublime_plugin_tests_base-1.0.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "21a08f9fad431a3fba32504ae184a7b7", "sha256": "8d2cfabd4d3f8b7777904f4475ff220035ecf04398b01be4f548af93cdac0f32" }, "downloads": -1, "filename": "sublime_plugin_tests_base-1.0.0.tar.gz", "has_sig": false, "md5_digest": "21a08f9fad431a3fba32504ae184a7b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9704, "upload_time": "2015-12-30T03:41:52", "url": "https://files.pythonhosted.org/packages/d5/7b/01f8c1fb2a7cb31a6cd336b48558dda8874d6298a7b03a77a59867485e7a/sublime_plugin_tests_base-1.0.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "33b65bc0c1fd8d00c13e48941fa24a12", "sha256": "95378ff9287884ac99fb3c7fb944f13e467c55efb9a691907148c53c5b654b07" }, "downloads": -1, "filename": "sublime_plugin_tests_base-1.0.0.zip", "has_sig": false, "md5_digest": "33b65bc0c1fd8d00c13e48941fa24a12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20395, "upload_time": "2015-12-30T03:41:57", "url": "https://files.pythonhosted.org/packages/64/66/7f7f2901ab343afaeb6db5c2d9ee5c4f72e5d5b44b17ee5ddf776a136acd/sublime_plugin_tests_base-1.0.0.zip" } ] }