semvec/pypi-packages huggingface dataset:
testing.redis 1.1.1
automatically setups a redis instance in a temporary directory, and destroys it after testing
License: Apache License 2.0

``testing.redis`` automatically setups a redis instance in a temporary directory, and destroys it after testing

.. image:: https://travis-ci.org/tk0miya/testing.redis.svg?branch=master
   :target: https://travis-ci.org/tk0miya/testing.redis

.. image:: https://coveralls.io/repos/tk0miya/testing.redis/badge.png?branch=master
   :target: https://coveralls.io/r/tk0miya/testing.redis?branch=master

.. image:: https://codeclimate.com/github/tk0miya/testing.redis/badges/gpa.svg
   :target: https://codeclimate.com/github/tk0miya/testing.redis

Install
=======
Use easy_install (or pip)::

   $ easy_install testing.redis

And ``testing.redis`` requires Redis server.


Usage
=====
Create Redis instance using ``testing.redis.RedisServer``::

  import redis
  import testing.redis

  # Launch new Redis server
  with testing.redis.RedisServer() as redis_server:
      r = redis.Redis(**redis_server.dsn())
      #
      # do any tests using Redis...
      #

  # Redis server is terminated here


``testing.redis`` automatically searchs for redis-server from ``$PATH``.
If you install redis to other directory, set ``redis_server`` keyword::

  redis = testing.redis.RedisServer(redis_server='/path/to/your/redis-server')


``testing.redis.RedisServer`` executes ``redis-server`` on instantiation.
On deleting RedisServer object, it terminates Redis instance and removes temporary directory.

If you want a database including any fixtures for your apps,
use ``copy_data_from`` keyword::

  # uses a copy of specified data directory of Redis.
  redis = testing.redis.RedisServer(copy_data_from='/path/to/your/database')


You can specify parameters for Redis with ``redis_conf`` keyword::

  # Enable appendonly mode
  redis = testing.redis.RedisServer(redis_conf={'appendonly': 'yes'})


For example, you can setup new Redis server for each testcases on setUp() method::

  import unittest
  import testing.redis

  class MyTestCase(unittest.TestCase):
      def setUp(self):
          self.redis = testing.redis.RedisServer()

      def tearDown(self):
          self.redis.stop()


Requirements
============
* Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5
* redis


License
=======
Apache License 2.0


History
=======

1.1.1 (2016-08-20)
-------------------
* Fix a bug

  - #1 Fix parameter handling

1.1.0 (2016-02-03)
-------------------
* Add timeout to server invoker
* Add testing.redis.RedisServerFactory
* Depend on ``testing.common.database`` package

1.0.3 (2015-04-06)
-------------------
* Fix bugs:

  - Do not call os.getpid() on destructor (if not needed)
  - Use absolute path for which command

1.0.2 (2014-06-19)
-------------------
* Add timeout on terminating redis-server
* Fix bugs

1.0.1 (2014-06-11)
-------------------
* Fix ImportError if caught SIGINT on py3

1.0.0 (2013-12-07)
-------------------
* First release
testing.elasticsearch2 1.0.0
automatically setups a elasticsearch instance in a temporary directory, and destroys it after testing
License: Apache License 2.0

About
=====
``testing.elasticsearch`` automatically setups a elasticsearch instance in a temporary directory, and destroys it after testing.

.. image:: https://travis-ci.org/tk0miya/testing.elasticsearch.svg?branch=master
   :target: https://travis-ci.org/tk0miya/testing.elasticsearch

.. image:: https://coveralls.io/repos/tk0miya/testing.elasticsearch/badge.png?branch=master
   :target: https://coveralls.io/r/tk0miya/testing.elasticsearch?branch=master

.. image:: https://codeclimate.com/github/tk0miya/testing.elasticsearch/badges/gpa.svg
   :target: https://codeclimate.com/github/tk0miya/testing.elasticsearch


Install
=======
Use pip::

   $ pip install testing.elasticsearch2

And ``testing.elasticsearch2`` requires Elasticsearch server in your PATH.


Usage
=====
Create Elasticsearch instance using ``testing.elasticsearch.Elasticsearch``::

  import testing.elasticsearch
  from sqlalchemy import create_engine

  # Lanuch new Elasticsearch server
  with testing.elasticsearch.Elasticsearch() as elasticsearch:
      # connect to Elasticsearch (using elasticsearch-py)
      es = Elasticsearch(**elasticsearch.dsn())

      #
      # do any tests using Elasticsearch...
      #

  # Elasticsearch server is terminated here


``testing.elasticsearch.Elasticsearch`` generates temporary config files and data directories.
On deleting Elasticsearch object, it terminates Elasticsearch instance and removes temporary files and directories.

If you want a database including indexes and any fixtures for your apps,
use ``copy_data_from`` keyword::

  # uses a copy of specified data directory of Elasticsearch.
  elasticsearch = testing.elasticsearch.Elasticsearch(copy_data_from='/path/to/your/index')


For example, you can setup new Elasticsearch server for each testcases on setUp() method::

  import unittest
  import testing.elasticsearch

  class MyTestCase(unittest.TestCase):
      def setUp(self):
          self.elasticsearch = testing.elasticsearch.Elasticsearch()

      def tearDown(self):
          self.elasticsearch.stop()


Requirements
============
* Python 2.7, 3.3, 3.4, 3.5

License
=======
Apache License 2.0


History
=======

1.0.0 (2016-08-20)
-------------------
* Drop python 2.6, 3.2 support
* Depend on testing.common.database >= 2.0.0
* Set booting timeout to 20sec
* Fix bugs:

  - #1: find_elasticsearch_yaml_path() does not refer elasticsearch_home argument
  - #2: Make ES_PATH absolute

0.9.1 (2016-02-04)
-------------------
* Depend on ``testing.common.database`` package

0.9.0 (2015-12-13)
-------------------
* First release