Skip to content

Commit

Permalink
add relevant consts to consts and use them in test_esutils
Browse files Browse the repository at this point in the history
  • Loading branch information
sxamit committed Jul 3, 2016
1 parent a8f1579 commit 86b4401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_esutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ def create_results(result_hits, failures=0):
}}

def test_is_get_query_with_results_valid_response_returns_true(self):
es_get_response = {"_type": "type", "_index": "index", "fields": {}, "_version": 1, "found": True, "_id": "id"}
es_get_response = {EsConst._TYPE: "type", EsConst._INDEX: "index", EsConst.FIELDS: {},
EsConst._VERSION: 1, EsConst.FOUND: True, EsConst._ID: "id"}
self.assertTrue(EsUtils.is_get_query_with_results(es_get_response))
4 changes: 4 additions & 0 deletions twistes/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class EsConst(object):
TOTAL = 'total'
FAILED = 'failed'
SHARDS = '_shards'
_INDEX = "_index"
_TYPE = "_type"
_VERSION = "_version"
_ID = "_id"
ALL_VALUES = '_all'
FIELDS = 'fields'
SCROLL_ID = 'scroll_id'
Expand Down

0 comments on commit 86b4401

Please sign in to comment.