File: conftest.py

package info (click to toggle)
django-environ 0.12.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 516 kB
  • sloc: python: 2,434; makefile: 171
file content (57 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This file is part of the django-environ.
#
# Copyright (c) 2021-2024, Serghei Iakovlev <oss@serghei.pl>
# Copyright (c) 2013-2021, Daniele Faraglia <daniele.faraglia@gmail.com>
#
# For the full copyright and license information, please view
# the LICENSE.txt file that was distributed with this source code.

import os
import pathlib
import sys

import pytest


@pytest.fixture
def solr_url():
    """Return Solr URL."""
    return 'solr://127.0.0.1:8983/solr'


@pytest.fixture
def whoosh_url():
    """Return Whoosh URL."""
    return 'whoosh:///home/search/whoosh_index'


@pytest.fixture
def xapian_url():
    """Return Xapian URL."""
    return 'xapian:///home/search/xapian_index'


@pytest.fixture
def simple_url():
    """Return simple URL."""
    return 'simple:///'


@pytest.fixture
def volume():
    """Return volume name is OS is Windows, otherwise None."""
    if sys.platform == 'win32':
        return pathlib.Path(os.getcwd()).parts[0]
    return None


@pytest.fixture(params=[
    'solr://127.0.0.1:8983/solr',
    'elasticsearch://127.0.0.1:9200/index',
    'whoosh:///home/search/whoosh_index',
    'xapian:///home/search/xapian_index',
    'simple:///'
])
def search_url(request):
    """Return Search Engine URL."""
    return request.param