diff options
author | Pjotr Prins | 2018-02-15 14:03:38 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-03-26 09:29:29 +0000 |
commit | e7f80eb6cf60bb117f943132049ec0b220ddcab4 (patch) | |
tree | f9e159e8cd182cb300f629040e5d0ba1e35b1b16 /wqflask/mock | |
parent | 3de1ecfa37b73b4cb011b634c8b4afc2362f858c (diff) | |
download | genenetwork2-e7f80eb6cf60bb117f943132049ec0b220ddcab4.tar.gz |
Added unittest example
Diffstat (limited to 'wqflask/mock')
-rw-r--r-- | wqflask/mock/__init__.py | 0 | ||||
-rw-r--r-- | wqflask/mock/es_double.py | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/wqflask/mock/__init__.py b/wqflask/mock/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/wqflask/mock/__init__.py 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] + }} |