Metadata-Version: 1.1
Name: pytest-solr
Version: 1.0.0
Summary: Solr process and client fixtures for py.test.
Home-page: https://github.com/kitconcept/pytest-solr
Author: kitconcept GmbH
Author-email: info@kitconcept.com
License: MIT
Description: .. image:: https://travis-ci.org/kitconcept/pytest-solr.svg?branch=master
            :target: https://travis-ci.org/kitconcept/pytest-solr
        
        .. image:: https://img.shields.io/pypi/v/pytest-solr.svg
            :target: https://pypi.python.org/pypi/pytest-solr/
            :alt: Latest Version
        
        .. image:: https://img.shields.io/pypi/status/pytest-solr.svg
            :target: https://pypi.python.org/pypi/pytest-solr/
            :alt: Egg Status
        
        .. image:: https://img.shields.io/pypi/l/pytest-solr.svg
            :target: https://pypi.python.org/pypi/pytest-solr/
            :alt: License
        
        Solr process and client fixtures for py.test.
        
        .. image:: https://raw.githubusercontent.com/kitconcept/pytest-solr/master/kitconcept.png
           :alt: kitconcept
           :target: https://kitconcept.com/
        
        Introduction
        ------------
        
        pytest-solr is a pytest plugin for the Apache Solr search server.
        It provides three pytest factories:
        
        solr_process:
          For starting and stopping the Solr server. This is session scoped.
        
        solr_core:
          For loading and unloading a Solr core configuration. This is module scoped.
        
        solr:
          For connecting to a Solr server during a test. This is function scoped.
        
        
        Solr Process
        ^^^^^^^^^^^^
        
        The solr_process factory starts and stops a the Solr process.
        An existing Solr executable is required for this.
        
        'executable':
          path to the Solr executable. Default value is 'downloads/solr-<SOLR_VERSION>/bin/solr'
        'host':
          hostname where Solr runs. Default value is 'localhost'.
        'port':
          port Solr uses. Default is value is '18983'.
        'core':
          Solr core that is used. Default value is 'solr'.
        'timeout':
          timeout to wait for Solr to start. Default value is '60' (seconds).
        
        Example::
        
          from pytest_solr.factories import solr_process
        
          solr_process = solr_process(
            executable='solr-6.5.0/bin/solr',
            host='localhost',
            port=8983,
            core='default',
            version='6.5.0',
            timeout=60
          )
        
        
        Solr Core
        ^^^^^^^^^
        
        The solr_core factory adds and removes a Solr core configuration.
        It expects two parameters, the Solr Process fixture name and the Solr core name.
        
        'solr_process_fixture_name':
          String with the name of the Solr Process. This is a required parameter.
        'solr_core_name':
          String with the name of the Solr core. Default value is 'default'.
        
        Example::
        
          from pytest_solr.factories import solr_core
        
          my_solr_core = solr_core('solr_process', 'my_solr_core')
        
        
        Solr
        ^^^^
        
        The Solr factory connects to Solr via pysolr.
        It expects a single parameter, the Solr core fixture name.
        
        'solr_core_fixture_name':
          String with the name of the Solr core. This is a required parameter.
        
        Example::
        
          # -*- coding: utf-8 -*-
          from pytest_solr.factories import solr_core
          from pytest_solr.factories import solr
        
          minimal = solr_core('solr_process', 'minimal')
          solr = solr('minimal')
        
          def test_exact_term_match(solr):
              solr.add([{'id': '1', 'title': 'bananas'}])
              assert 1 == solr.search('title:bananas').hits
        
        The solr fixture can then be injected into the test function and used to add documents to solr or search for terms.
        
        See the `pysolr documentation <https://github.com/django-haystack/pysolr>`_. for more details.
        
        
        Installation
        ------------
        
        Install pytest-solr with pip::
        
          $ pip install pytest-solr
        
        
        Usage
        -----
        
        Create a solr core with the name 'minimal' and inject the use the solr factory into a test function to use it::
        
            # -*- coding: utf-8 -*-
            from pytest_solr.factories import solr_core
            from pytest_solr.factories import solr
        
            minimal = solr_core('solr_process', 'minimal')
            solr = solr('minimal')
        
        
            def test_exact_term_match(solr):
                solr.add([{'id': '1', 'title': 'bananas'}])
                assert 1 == solr.search('title:bananas').hits
        
        License
        -------
        
        Copyright kitconcept GmbH.
        
        Distributed under the terms of the MIT license, pytest-solr is free and Open Source software.
        
        
        Contribute
        ----------
        
        - `Source code at Github <https://github.com/kitconcept/pytest-solr>`_
        - `Issue tracker at Github <https://github.com/kitconcept/pytest-solr/issues>`_
        
        
        Support
        -------
        
        If you are having issues, `please let us know <https://github.com/kitconcept/pytest-solr/issues>`_. If you require professional support feel free to contact us at `info@kitconcept.com. <mailto:info@kitconcept.com>`_
        
        
        1.0.0 (2020-05-11)
        ------------------
        
        - Set Solr to always_commit=True.
          [timo]
        
        - Black.
          [timo]
        
        - Make Solr 7.7.3 the new default.
          [timo]
        
        
        1.0a1 (2017-06-22)
        ------------------
        
        - Initial release.
          [timo]
        
        
Keywords: tests py.test pytest fixture solr
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
