~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/test_search.py

  • Committer: Aaron Bentley
  • Date: 2013-03-28 16:55:07 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: aaron@canonical.com-20130328165507-yoiwb2pdby5tz9n8
Remove all mention of Xapian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
__metaclass__ = type
5
5
 
6
 
from contextlib import contextmanager
7
6
from unittest import TestCase
8
7
 
9
8
from pyelasticsearch.exceptions import ElasticHttpNotFoundError
10
9
 
11
10
from charmworld.search import (
12
 
    ElasticSearchClient,
13
11
    exact_fields,
14
12
    free_text_fields,
15
13
)
16
 
from charmworld.testing import factory
17
 
from charmworld.utils import get_ini
18
 
 
19
 
 
20
 
@contextmanager
21
 
def temp_index_client():
22
 
    client = ElasticSearchClient.from_settings(get_ini(), 'temp_index')
23
 
    try:
24
 
        yield client
25
 
    finally:
26
 
        client.delete_index()
 
14
from charmworld.testing import (
 
15
    factory,
 
16
    temp_index_client,
 
17
)
27
18
 
28
19
 
29
20
class TestElasticSearchClient(TestCase):