@httpretty.activate
def test_create_queryset_with_host_string():
    # When create a queryset
    t = QuerySet("localhost", index="bar")

    # And I have records
    response = {
       "took": 1,
       "hits": {
          "total": 1,
          "max_score": 1,
          "hits": [
             {
                "_index": "bar",
                "_type": "baz",
                "_id": "1",
                "_score": 10,
                "_source": {
                   "foo": "bar"
                },
                "sort": [
                   1395687078000
                ]
             }
          ]
       }
    }

    httpretty.register_uri(httpretty.GET, "http://localhost:9200/bar/_search",
                       body=json.dumps(response),
                       content_type="application/json")

    # When I run a query
    results = t[0:1]

    # Then I see the response.
    len(results).should.equal(1)
documentation
dataset/ETHPy150Open Yipit/pyeqs/tests/unit/test_connection.py/test_create_queryset_with_host_string--crossover with--dataset/ETHPy150Open GrahamDumpleton/wrapt/tests/test_outer_staticmethod.py/Class.function