{
"info": {
"author": "Gabriel Falcao",
"author_email": "gabriel@nacaolivre.org",
"bugtrack_url": null,
"classifiers": [],
"description": "Agile\n=====\n\n.. image:: https://travis-ci.org/gabrielfalcao/agile.svg?branch=master\n :target: https://travis-ci.org/gabrielfalcao/agile\n\n.. image:: https://codecov.io/gh/gabrielfalcao/agile/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/gabrielfalcao/agile\n\n\nMeta-package for python with tools for an agile development workflow.\n\n\nadd it to your project\n----------------------\n\n.. code:: bash\n\n pip install agile\n\n\nwhat is in it?\n--------------\n\nmock\n^^^^\n\nThe `mock `__ library is the\neasiest and most expressive way to mock in python.\n\nexample: mocking I/O calls:\n\n\n.. code:: python\n\n # cool-git-project/my_cool_library/core.py\n import io\n import json\n\n\n class JSONDatabase(object):\n def __init__(self, filename=None, data={}):\n self.filename = filename\n self.data = data\n\n def state_to_json(self):\n return json.dumps(self.data)\n\n def save(self):\n # open file\n fd = io.open(self.filename, 'wb')\n fd.write(self.state_to_json())\n fd.close()\n\n.. code:: python\n\n # cool-git-project/tests/unit/test_core.py\n from mock import patch\n from my_cool_library.core import JSONDatabase\n\n\n @patch('my_cool_library.core.io')\n @patch('my_cool_library.core.JSONDatabase.state_to_json')\n def test_json_database_save(state_to_json, io):\n (\"JSONDatabase.save() should open the database file, \"\n \"and write the latest json state of the data\")\n\n # Given that the call to io.open returns a mock\n mocked_fd = io.open.return_value\n\n # And that I create an instance of JSONDatabase with some data\n jdb = JSONDatabase('my-database.json', data={'foo': 'bar'})\n\n # When I call .save()\n jdb.save()\n\n # Then the file descriptor should have been opened in write mode,\n # and pointing to the right file\n io.open.assert_called_once_with('my-database.json', 'wb')\n\n # And the returned file descriptor should have been used\n # to write the return value from state_to_json\n mocked_fd.write.assert_called_once_with(state_to_json.return_value)\n\n # And then the file descriptor should have been closed\n mocked_fd.close.assert_called_once_with()\n\nThe mock documentation can be found\n`here `__\n\nsure\n^^^^\n\nSure modifies the all the python objects in memory, adding a special\nproperty ``should``, that allows you to test aspects of the given\nobject.\n\nLet's see it in practice.\n\nStill considering the project from the *mock* example above, now let's\ntest that ``state_to_json`` returns a json string.\n\n.. code:: python\n\n def test_json_database_state_to_json():\n (\"JSONDatabase.state_to_json() should return a valid json string\")\n # Given that I have an instance of the database containing some data\n jdb = JSONDatabase(data={'name': 'Foo Bar'})\n\n # When I call .state_to_json\n result = jdb.state_to_json()\n\n # Then it should return a valid JSON\n result.should.equal('{\"name\": \"Foo Bar\"}')\n\nThe sure documentation is available\n`here `__\n\nnose + coverage + rednose\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: bash\n\n nosetests -vsx --rednose --with-coverage --cover-package=my_cool_library tests/unit\n # or\n nosetests -vsx --rednose --with-coverage --cover-package=my_cool_library tests/functional\n\nNose is a great test runner, recursively scans for files that start with\n``test_`` and and with ``.py``. It supports plugins and agile installs\ntwo cool plugins:\n\ncoverage\n\n\ncoverage is a module that collects test coverage data so that nose can\nshow a summary of what lines of python code don't have test coverage.\n\nrednose\n\n\nRednose is a plugin that prints a prettier output when running the\ntests, and show bad things in **red** which highlights problems and make\nit easier to see where is the problem, pretty awesome.\n\nMore over, **as long as you write single-line docstrings to describe\nyour tests** rednose will show the whole sentence, pretty and with no\nchops.\n\n.. code:: bash\n\n JSONDatabase.save() should open the database file, and write the latest json state of the data ... passed\n JSONDatabase.state_to_json() should return a valid json string ... passed\n\n -----------------------------------------------------------------------------\n 2 tests run in 0.0 seconds (2 tests passed)\n\nps.: nose actually matches files that contain ``test`` in the name and\ncan also find ``TestCase`` classes, but I recommend using function-based\ntests, for clarity, expressiveness and to enforce simplicity. We\ndevelopers tend to add too much logic to setup and teardown functions\nwhen writing test-based class.\n\nGists:\n------\n\ncreating a basic python test infrastructure\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: bash\n\n mkdir -p tests/{unit,functional}\n touch tests/{unit,functional,}/__init__.py\n printf 'import sure\\nsure\\n' > tests/unit/__init__.py\n printf 'import sure\\nsure\\n' > tests/functional/__init__.py\n\nnow go ahead and add a unit test file, try to name your test file such\nthat it resembles module being tested, for example, let's say you are\ntesting ``my_cool_library/engine.py``, you could create a test file like\nthis\n\n.. code:: bash\n\n printf \"# -*- coding: utf-8 -*-\\n\\n\" > tests/unit/test_engine.py\n\n.. |Build Status| image:: https://travis-ci.org/gabrielfalcao/agile.svg\n :target: https://travis-ci.org/gabrielfalcao/agile",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/gabrielfalcao/agile",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "agile",
"package_url": "https://pypi.org/project/agile/",
"platform": "",
"project_url": "https://pypi.org/project/agile/",
"project_urls": {
"Homepage": "http://github.com/gabrielfalcao/agile"
},
"release_url": "https://pypi.org/project/agile/1.5.1/",
"requires_dist": null,
"requires_python": "",
"summary": "A meta-package containing a full toolset for agile development with TDD",
"version": "1.5.1"
},
"last_serial": 3817828,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "e015fc68720b5c7047d53311c5f6d0f4",
"sha256": "63551604169a1d82658c312b158b5310626e8a858e31108ac73e7bad21e4a018"
},
"downloads": -1,
"filename": "agile-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "e015fc68720b5c7047d53311c5f6d0f4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 918,
"upload_time": "2015-02-04T19:00:37",
"url": "https://files.pythonhosted.org/packages/9e/0e/e390f4283ee0b9e40b952150e8c3ca1a362a415b619d74edf0ea240c407d/agile-1.0.0.tar.gz"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "2e284377a656e9da8f509d010717fee2",
"sha256": "058a956e84743e65e2da05a4d8fbcfbb3ddb74383aba8e89e21000d55e347f68"
},
"downloads": -1,
"filename": "agile-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2e284377a656e9da8f509d010717fee2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 928,
"upload_time": "2015-02-04T21:53:45",
"url": "https://files.pythonhosted.org/packages/22/f2/5bca08b1a6496490d81ed57e9a68023a39db06bf6ffc58d94bec62b058ba/agile-1.1.0.tar.gz"
}
],
"1.3.0": [
{
"comment_text": "",
"digests": {
"md5": "c095c102eea071bbba0b2637553b52e2",
"sha256": "d96bf00a4b9c7253912a0e2e34b39ff671499496bd6875bf67f3b8cefa404be2"
},
"downloads": -1,
"filename": "agile-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "c095c102eea071bbba0b2637553b52e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 963,
"upload_time": "2015-04-14T16:17:03",
"url": "https://files.pythonhosted.org/packages/3d/d1/891d508498dd0c4ee17c7ecc9740cb7b21adbe1cf7a89d840883ed79fc44/agile-1.3.0.tar.gz"
}
],
"1.3.1": [
{
"comment_text": "",
"digests": {
"md5": "613c6fbe69fe7cbb08fa995ed98bd92d",
"sha256": "835e55be3ac2c9983de02bc00ce71ea88f93be3ffc8a4db783457cb1da811340"
},
"downloads": -1,
"filename": "agile-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "613c6fbe69fe7cbb08fa995ed98bd92d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 962,
"upload_time": "2015-05-11T19:58:29",
"url": "https://files.pythonhosted.org/packages/fb/ce/d4995605196e4ffaed0160452d69af78b5b73fe42aeff464805cc28827fe/agile-1.3.1.tar.gz"
}
],
"1.4.0": [
{
"comment_text": "",
"digests": {
"md5": "ef5b75308fac6a9718ad2429871775aa",
"sha256": "c830b9bfbc92a938d6825fb175000d112e69d2e86f308a8704787c6d93a5f4b4"
},
"downloads": -1,
"filename": "agile-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "ef5b75308fac6a9718ad2429871775aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 995,
"upload_time": "2016-10-18T03:26:30",
"url": "https://files.pythonhosted.org/packages/43/7d/2a4981942ce28225a31ebbbdfffd55b472e4ae4345dc0df891037e3767e7/agile-1.4.0.tar.gz"
}
],
"1.5.0": [
{
"comment_text": "",
"digests": {
"md5": "6b5af5b3904d84bf660467b75d19b4eb",
"sha256": "e35271b1172f6630ff9829a28fae706d2e11a4eeb551120072de9ce85daf4629"
},
"downloads": -1,
"filename": "agile-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "6b5af5b3904d84bf660467b75d19b4eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3297,
"upload_time": "2018-04-28T22:58:21",
"url": "https://files.pythonhosted.org/packages/10/2d/8295d2b10a61a97671fe831221fa79dd7ca43a70dafc749ec5c5f756829a/agile-1.5.0.tar.gz"
}
],
"1.5.1": [
{
"comment_text": "",
"digests": {
"md5": "56bf4e3c4e7d5ddfa06a969655ed4db5",
"sha256": "821b31e11f798d86129e5c1b3536bf8a15b159723b9efb31c1066d4da6b47217"
},
"downloads": -1,
"filename": "agile-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "56bf4e3c4e7d5ddfa06a969655ed4db5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3871,
"upload_time": "2018-04-29T00:04:44",
"url": "https://files.pythonhosted.org/packages/ea/ee/32f085e42a5a05213053220468007d43be3fa5c59bd5fc5f79e6c9bca97c/agile-1.5.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "56bf4e3c4e7d5ddfa06a969655ed4db5",
"sha256": "821b31e11f798d86129e5c1b3536bf8a15b159723b9efb31c1066d4da6b47217"
},
"downloads": -1,
"filename": "agile-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "56bf4e3c4e7d5ddfa06a969655ed4db5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3871,
"upload_time": "2018-04-29T00:04:44",
"url": "https://files.pythonhosted.org/packages/ea/ee/32f085e42a5a05213053220468007d43be3fa5c59bd5fc5f79e6c9bca97c/agile-1.5.1.tar.gz"
}
]
}