{ "info": { "author": "Bystroushaak", "author_email": "bystrousak@kitakitsune.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "Introduction\n============\n\n.. image:: https://badge.fury.io/py/zeo_connector_defaults.png\n :target: https://pypi.python.org/pypi/zeo_connector_defaults\n\n.. image:: https://img.shields.io/pypi/dm/zeo_connector_defaults.svg\n :target: https://pypi.python.org/pypi/zeo_connector_defaults\n\n.. image:: https://img.shields.io/pypi/l/zeo_connector_defaults.svg\n\n.. image:: https://img.shields.io/github/issues/Bystroushaak/zeo_connector_defaults.svg\n :target: https://github.com/Bystroushaak/zeo_connector_defaults/issues\n\nDefault configuration files and configuration file generator for zeo_connector_.\n\n.. _zeo_connector: https://github.com/Bystroushaak/zeo_connector\n\nDocumentation\n-------------\n\nThis project provides generators of the testing environment for the ZEO-related tests. It also provides generator, for the basic ZEO configuration files.\n\nzeo_connector_gen_defaults.py\n+++++++++++++++++++++++++++++\n\nThis script simplifies the process of generation of ZEO configuration files.\n\nZEO tests\n+++++++++\n\nTypically, when you test your program which is using the ZEO database, you need to generate the database files, then run new thread with ``runzeo`` program, do tests, cleanup and stop the thread.\n\nThis module provides two functions, which do exactly this:\n\n - zeo_connector_defaults.generate_environment()\n - zeo_connector_defaults.cleanup_environment()\n\ngenerate_environment\n^^^^^^^^^^^^^^^^^^^^\nThis function will create temporary directory in ``/tmp`` and copy template files for ZEO client and server into this directory. Then it starts new thread with ``runzeo`` program using the temporary server configuration file.\n\nNames of the files may be resolved using ``tmp_context_name()`` function.\n\nNote:\n This function works best, if added to setup part of your test environment.\n\ncleanup_environment\n^^^^^^^^^^^^^^^^^^^\n\nFunction, which stops the running ``runzeo`` thread and delete all the temporary files.\n\nNote:\n This function works best, if added to setup part of your test environment.\n\nContext functions\n^^^^^^^^^^^^^^^^^\n\nThere is also two `temp environment access functions`:\n\n - tmp_context_name()\n - tmp_context()\n\nBoth of them take one `fn` argument and return name of the file (``tmp_context_name()``) or content of the file (``tmp_context()``) in context of random temporary directory.\n\nFor example:\n\n.. code-block:: python\n\n tmp_context_name(\"zeo_client.conf\")\n\nreturns the absolute path to the file ``zeo_client.conf``, which may be for example ``/tmp/tmp1r5keh/zeo_client.conf``.\n\nYou may also call it without the arguments, which will return just the name of the temporary directory:\n\n.. code-block:: python\n\n tmp_context_name()\n\nwhich should return something like ``/tmp/tmp1r5keh``.\n\nTests example\n+++++++++++++\n\nHere is the example how your test may look like:\n\n.. code-block:: python\n\n #! /usr/bin/env python\n # -*- coding: utf-8 -*-\n #\n # Interpreter version: python 2.7\n #\n # Imports =====================================================================\n import pytest\n\n from zeo_connector_defaults import generate_environment\n from zeo_connector_defaults import cleanup_environment\n from zeo_connector_defaults import tmp_context_name\n\n\n # Setup =======================================================================\n def setup_module(module):\n generate_environment()\n\n\n def teardown_module(module):\n cleanup_environment()\n\n\n # Fixtures ====================================================================\n @pytest.fixture\n def zeo_conf_wrapper():\n return ZEOConfWrapper(\n conf_path=tmp_context_name(\"zeo_client.conf\"),\n ...\n\n # Tests =======================================================================\n def test_something(zeo_conf_wrapper):\n ...\n\nInstallation\n------------\n\nModule is `hosted at PYPI `_, and can be easily installed using `PIP`_::\n\n sudo pip install zeo_connector_defaults\n\n.. _PIP: http://en.wikipedia.org/wiki/Pip_%28package_manager%29\n\n\nSource code\n-----------\n\nProject is released under the MIT license. Source code can be found at GitHub:\n\n- https://github.com/Bystroushaak/zeo_connector_defaults\n\n\nChangelog\n=========\n\n0.2.2\n-----\n - Small bugfix.\n - Removed unused files.\n\n0.2.1\n-----\n - Switched to complete randomly generated ZEO environment (random name in /tmp, and random ports for ZEO server process).\n\n0.2.0\n-----\n - Bugfix of path parsing.\n\n0.1.0\n-----\n - Project created.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Bystroushaak/zeo_connector_defaults", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "zeo_connector_defaults", "package_url": "https://pypi.org/project/zeo_connector_defaults/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zeo_connector_defaults/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Bystroushaak/zeo_connector_defaults" }, "release_url": "https://pypi.org/project/zeo_connector_defaults/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Default conf. files and conf. file generator for `zeo_connector`.", "version": "0.2.2" }, "last_serial": 1830663, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2f8287a3fa480122ddcfa537e99662e3", "sha256": "6b65d2515b95d2d4f96853d2a55248b9ad85791b177d08b6b18cca5f3158e6d8" }, "downloads": -1, "filename": "zeo_connector_defaults-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2f8287a3fa480122ddcfa537e99662e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5796, "upload_time": "2015-10-23T13:05:21", "url": "https://files.pythonhosted.org/packages/8a/e9/4665780fac3b7af12e6994eee66802b23fede4511dd76e94628655f360c5/zeo_connector_defaults-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "24f5315477b1192d16983cebfd883d7f", "sha256": "325f28267b9224e1cfe01815611957d5d7a0a6ab4496e61e77147e004b4e0f31" }, "downloads": -1, "filename": "zeo_connector_defaults-0.2.0.tar.gz", "has_sig": false, "md5_digest": "24f5315477b1192d16983cebfd883d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5827, "upload_time": "2015-10-23T13:21:55", "url": "https://files.pythonhosted.org/packages/72/d8/9b70128000b8757a256419626ac2e1c0bd1d6debc044d0d0b856de557b1b/zeo_connector_defaults-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "bc70c8cf5eef34a9624c2ff6dd6cf3a0", "sha256": "ad7d154a911eb911122ce4ee6f5da5972c00c7f64336bc0860094c9019b82760" }, "downloads": -1, "filename": "zeo_connector_defaults-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bc70c8cf5eef34a9624c2ff6dd6cf3a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6635, "upload_time": "2015-11-24T03:50:16", "url": "https://files.pythonhosted.org/packages/2f/bf/31222bc361d5baa123f52381b6946060f3b408038097bdb13e516cb2e9c6/zeo_connector_defaults-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "2dfb0ad5525cf5793bca0050897ee812", "sha256": "fee39b89e4994f2ac48a3b792a324cc39ed2a020899c1caeb1b89fa970c7cde7" }, "downloads": -1, "filename": "zeo_connector_defaults-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2dfb0ad5525cf5793bca0050897ee812", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6539, "upload_time": "2015-11-24T03:54:03", "url": "https://files.pythonhosted.org/packages/3f/f0/52a856fb00ef7474cf884c6feb0e56def0ee3cc406bdd8eaeba61a0a7125/zeo_connector_defaults-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2dfb0ad5525cf5793bca0050897ee812", "sha256": "fee39b89e4994f2ac48a3b792a324cc39ed2a020899c1caeb1b89fa970c7cde7" }, "downloads": -1, "filename": "zeo_connector_defaults-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2dfb0ad5525cf5793bca0050897ee812", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6539, "upload_time": "2015-11-24T03:54:03", "url": "https://files.pythonhosted.org/packages/3f/f0/52a856fb00ef7474cf884c6feb0e56def0ee3cc406bdd8eaeba61a0a7125/zeo_connector_defaults-0.2.2.tar.gz" } ] }