Make offset in search work. from is a reserved word in python so use from_

Fixes #13
Thanks llonchj,  danfairs, vanatteveldt and RonRothman!
This commit is contained in:
Honza Kral
2013-10-17 22:01:25 +02:00
parent 798778ee0a
commit 2bb16fe7ed
3 changed files with 18 additions and 3 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
from elasticsearch.client import _normalize_hosts
from ..test_cases import TestCase
from ..test_cases import TestCase, ElasticsearchTestCase
class TestNormalizeHosts(TestCase):
def test_none_uses_defaults(self):
@@ -17,3 +17,9 @@ class TestNormalizeHosts(TestCase):
def test_dicts_are_left_unchanged(self):
self.assertEquals([{"host": "local", "extra": 123}], _normalize_hosts([{"host": "local", "extra": 123}]))
class TestClient(ElasticsearchTestCase):
def test_from_in_search(self):
self.client.search(index='i', doc_type='t', from_=10)
calls = self.assert_url_called('GET', '/i/t/_search')
self.assertEquals([({'from': '10'}, None)], calls)