diff options
author | Muriithi Frederick Muriuki | 2018-02-16 07:19:58 +0300 |
---|---|---|
committer | Muriithi Frederick Muriuki | 2018-02-16 07:19:58 +0300 |
commit | 25e1c38af3a987e6ce2f3a90ddfeb5855dd0d746 (patch) | |
tree | 8026d9511aec117d4010f0498c3eebf0d1bd95e6 /wqflask/mock/es_double.py | |
parent | 1defefd05d0eb658fb5922fc755547261a5e914a (diff) | |
parent | 3a26e0fb7b88cd9c105a1f7e9ca9d5a8b2130d82 (diff) | |
download | genenetwork2-25e1c38af3a987e6ce2f3a90ddfeb5855dd0d746.tar.gz |
Merge branch 'pjotrp-gn-testing-es' into testing
Diffstat (limited to 'wqflask/mock/es_double.py')
-rw-r--r-- | wqflask/mock/es_double.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wqflask/mock/es_double.py b/wqflask/mock/es_double.py new file mode 100644 index 00000000..6ef8a1b9 --- /dev/null +++ b/wqflask/mock/es_double.py @@ -0,0 +1,15 @@ +class ESDouble(object): + def __init__(self): + self.items = {} + + def ping(self): + return true + + def create(self, index, doc_type, body, id): + self.items["index"] = {doc_type: {"id": id, "_source": data}} + + def search(self, index, doc_type, body): + return { + "hits": { + "hits": self.items[index][doc_type][body] + }} |