~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/tests/test_search.py

  • Committer: Tarmac
  • Author(s): Aaron Bentley
  • Date: 2013-03-28 18:56:12 UTC
  • mfrom: (179.3.4 remove-xappy)
  • Revision ID: tarmac-20130328185612-6f635k1h2wxh4eaw
[r=sinzui][bug=1099856][author=abentley] Remove Xapian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from charmworld.views import search
7
7
 
8
8
 
9
 
class ResultFake(list):
10
 
    def __init__(self, results):
11
 
        super(ResultFake, self).__init__(results)
12
 
        self.results = results
13
 
        self.matches_estimated = len(results)
14
 
 
15
 
 
16
9
RETURN_VAL = {
17
 
    'results': ResultFake([]),
 
10
    'results': [],
18
11
    'search_time': 0.0,
19
12
    'charm_total': 0,
20
13
    'matches': 0,
31
24
        request = self.getRequest(params=terms)
32
25
        response = search.search(request)
33
26
 
34
 
        mock.assert_called_with('foo', allow_all_fields=True)
 
27
        mock.assert_called_with('foo')
35
28
        self.assertEqual(keys, sorted(response.keys()))
36
29
        self.assertEqual(0, response['charm_total'])
37
30
        self.assertEqual([], response['results'])