Skip to content

Commit

Permalink
Merge pull request #10 from xrmx/matchesinitsignature
Browse files Browse the repository at this point in the history
Make the FakeElasticsearch __init__ signature match the one from Elasticsearch
  • Loading branch information
vrcmarcos authored Jul 24, 2018
2 parents d115956 + 63018b4 commit 7bda492
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: python
python:
- "2.7"
- "3.6"
install:
- pip install -r requirements.txt
- pip install -r requirements_test.txt
- pip install coveralls
script:
make test
after_success:
coveralls
coveralls
8 changes: 7 additions & 1 deletion elasticmock/fake_elasticsearch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

import json
import sys

from elasticsearch import Elasticsearch
from elasticsearch.client.utils import query_params
Expand All @@ -9,10 +10,15 @@
from elasticmock.utilities import get_random_id


PY3 = sys.version_info[0] == 3
if PY3:
unicode = str


class FakeElasticsearch(Elasticsearch):
__documents_dict = None

def __init__(self):
def __init__(self, hosts=None, transport_class=None, **kwargs):
self.__documents_dict = {}

@query_params()
Expand Down

0 comments on commit 7bda492

Please sign in to comment.