Example #1
0
    def test_stats(self, rget):
        def mocked_get(url, **options):
            return Response({'documents': 1},
                            200,
                            headers={'content-type': 'application/json'})

        rget.side_effect = mocked_get

        result = autocompeter.stats()
        eq_(result, {'documents': 1})
    def test_stats(self, rget):

        def mocked_get(url, **options):
            return Response(
                {'documents': 1},
                200,
                headers={
                    'content-type': 'application/json'
                }
            )

        rget.side_effect = mocked_get

        result = autocompeter.stats()
        eq_(result, {'documents': 1})
Example #3
0
def autocompeter_stats(request):
    return stats()
Example #4
0
def autocompeter_stats(request):
    return stats()