{ "info": { "author": "Roger Ineichen, Projekt01 GmbH", "author_email": "dev@projekt01.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This package provides a elasticsearch server stub setup based on a real\nelasticsearch server.\n\n\n.. contents::\n\n======\nREADME\n======\n\nsetup\n-----\n\nThis test is using an elasticsearch server. The test setUp method used for this\ntest is calling our startElasticSearchServer method which is starting an\nelasticsearch server. The first time this test get called a new elasticsearch\nserver will get downloaded. The test setup looks like::\n\n def test_suite():\n return unittest.TestSuite((\n doctest.DocFileSuite('README.txt',\n setUp=testing.doctestSetUp, tearDown=testing.doctestTearDown,\n optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,\n encoding='utf-8'),\n ))\n\nIf you like to set some custom settings, you can use the confSource which must\npoint to a config folder with elasticsearch.yml or elasticsearch.json and\nlogging.yml and optional mapping definitions. Your custom doctest setUp and\ntearDown method could look like::\n\n def mySetUp(test):\n # use default elasticsearch with our server and conf source dir\n here = os.path.dirname(__file__)\n serverDir = os.path.join(here, 'server')\n confSource = os.path.join(here, 'config')\n p01.elasticstub.testing.startElasticSearchServer(serverDir=serverDir,\n confSource=confSource)\n\n def myTearDown(test):\n p01.elasticstub.testing.stopElasticSearchServer()\n # do some custom teardown stuff here\n\n\ntesting\n-------\n\nLet's setup a python httplib connection:\n\n >>> import httplib\n >>> conn = httplib.HTTPConnection('localhost', 45200)\n\nand test the cluster state:\n\n >>> conn.request('GET', '_cluster/state')\n >>> response = conn.getresponse()\n >>> response.status\n 200\n\n >>> import json\n >>> from pprint import pprint\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'blocks': {},\n u'cluster_name': u'p01_elasticstub_testing',\n u'master_node': u'...',\n u'metadata': {u'cluster_uuid': u'...',\n u'index-graveyard': {u'...': []},\n u'indices': {},\n u'templates': {}},\n u'nodes': {u'...': {u'attributes': {},\n u'ephemeral_id': u'...',\n u'name': u'...',\n u'transport_address': u'...'}},\n u'routing_nodes': {u'nodes': {u'...': []},\n u'unassigned': []},\n u'routing_table': {u'indices': {}},\n u'state_uuid': u'...',\n u'version': 2}\n\n\nAs you can see our mapping is empty:\n\n >>> conn.request('GET', '/testing/test/_mapping')\n >>> response = conn.getresponse()\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'error': {u'index': u'testing',\n u'index_uuid': u'_na_',\n u'reason': u'no such index',\n u'resource.id': u'testing',\n u'resource.type': u'index_or_alias',\n u'root_cause': [{u'index': u'testing',\n u'index_uuid': u'_na_',\n u'reason': u'no such index',\n u'resource.id': u'testing',\n u'resource.type': u'index_or_alias',\n u'type': u'index_not_found_exception'}],\n u'type': u'index_not_found_exception'},\n u'status': 404}\n\n\nLet's index a simple item:\n\n >>> body = json.dumps({u'title': u'Title'})\n >>> conn.request('POST', '/testing/test/1', body)\n >>> response = conn.getresponse()\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'_id': u'1',\n u'_index': u'testing',\n u'_shards': {u'failed': 0, u'successful': 1, u'total': 2},\n u'_type': u'test',\n u'_version': 1,\n u'created': True,\n u'result': u'created'}\n\nrefresh:\n\n >>> conn.request('GET', '/testing/test/_refresh')\n >>> response = conn.getresponse()\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'_id': u'_refresh',\n u'_index': u'testing',\n u'_type': u'test',\n u'found': False}\n\nLet's set a mapping:\n\n >>> body = json.dumps({'test': {'properties': {'title': {'type': 'string'}}}})\n >>> conn.request('POST', '/testing/test/_mapping', body)\n >>> response = conn.getresponse()\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'acknowledged': True}\n\nand test our mapping again:\n\n >>> conn.request('GET', '/testing/test/_mapping')\n >>> response = conn.getresponse()\n >>> body = response.read()\n >>> pprint(json.loads(body))\n {u'testing': {u'mappings': {u'test': {u'properties': {u'title': {u'fields': {u'keyword': {u'ignore_above': 256,\n u'type': u'keyword'}},\n u'type': u'text'}}}}}}\n\n\n=======\nCHANGES\n=======\n\n0.5.4 (2017-11-02)\n------------------\n\n- switch to elasticsearch 5.6.4 and adjust startup script environment setup\n\n- removed thrift plugin support\n\n- adjust default elasticsearch config, added log4j config file\n\n\n0.5.3 (2014-07-10)\n------------------\n\n- switch to elasticsearch version 1.2.1. Note; version 1.2.2 does not work at\n least on windows. Startup quits with en error like\n {1.2.2}: Initialization Failed ...\n ExecutionError[java.lang.IncompatibleClassChangeError: Implementing class] IncompatibleClassChangeError[Implementing class]\n\n\n0.5.2 (2012-12-22)\n------------------\n\n- switch to elasticsearch 0.20.1. Note; there is no need to switch to newer\n releases just for get the latest version. Simply use the downloadURL\n attribute for set a newer elasticsearch version download url\n\n- It seems that the auto mapping doesn't work anymore by default. Added explicit\n mapping setup after inserting first item. This seems to wrk as it should.\n\n- bugfix: adjust base url, if used with version, from git to elasticsearch\n\n\n0.5.1 (2012-12-10)\n------------------\n\n- switch to elasticsearch 0.20.0\n\n- added version argument to startElasticSearchServer\n\n- cleanup imports\n\n\n0.5.0 (2012-11-18)\n------------------\n\n- initial release tested on win 32bit and posix 32bit. NOT tested on win 64bit,\n posix 64bit and mac 32/64bit systems.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/p01.elasticstub", "keywords": "Zope3 z3c p01 elasticsearch server stub setup", "license": "ZPL 2.1", "maintainer": "", "maintainer_email": "", "name": "p01.elasticstub", "package_url": "https://pypi.org/project/p01.elasticstub/", "platform": "", "project_url": "https://pypi.org/project/p01.elasticstub/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/p01.elasticstub" }, "release_url": "https://pypi.org/project/p01.elasticstub/0.5.4/", "requires_dist": null, "requires_python": "", "summary": "Elasticsearch server stub setup", "version": "0.5.4" }, "last_serial": 3299870, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "85a45aa6d36ea5b5e5211f16eb06bf05", "sha256": "73c9f3cd02b5f743153ec69a0b88ed7943c73031950acb55e97d577e5be54ff5" }, "downloads": -1, "filename": "p01.elasticstub-0.5.0.zip", "has_sig": false, "md5_digest": "85a45aa6d36ea5b5e5211f16eb06bf05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29424, "upload_time": "2012-11-18T22:16:42", "url": "https://files.pythonhosted.org/packages/a9/6f/8f4bfe7ba6f17523bd026b8fc066f17117e009260a56b6c00aba70396afd/p01.elasticstub-0.5.0.zip" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "4add8b1c8902093de20872f3dde03e8a", "sha256": "8afc5a2937aa9f712cc03eead1ab8800d262b0e579a2de1f410aca9ebb77f209" }, "downloads": -1, "filename": "p01.elasticstub-0.5.1.zip", "has_sig": false, "md5_digest": "4add8b1c8902093de20872f3dde03e8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29640, "upload_time": "2012-12-10T03:54:06", "url": "https://files.pythonhosted.org/packages/ad/19/5f9d2fcfcf5805631a6b3b15b0e3fa9c82bf7a618782c66f9f461a38e4d0/p01.elasticstub-0.5.1.zip" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "ed7e05bb4a5e548426ae8818f6e019f6", "sha256": "30dc84d204f7bd2f12d181e5944f757852452171cfcfe4a48b517b90db2e00da" }, "downloads": -1, "filename": "p01.elasticstub-0.5.2.zip", "has_sig": false, "md5_digest": "ed7e05bb4a5e548426ae8818f6e019f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30161, "upload_time": "2012-12-22T05:39:37", "url": "https://files.pythonhosted.org/packages/4b/09/9a79224b353f3d1025750f0a0c8771f847a49132e08224787c5d93b3ef01/p01.elasticstub-0.5.2.zip" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "e350759f9a924f5b4a770bb17e19ca14", "sha256": "0425a67a0bf0213c5872dd8ce7aca79c99b24509dd17b8b79bfffed32a3ef33c" }, "downloads": -1, "filename": "p01.elasticstub-0.5.3.zip", "has_sig": false, "md5_digest": "e350759f9a924f5b4a770bb17e19ca14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30605, "upload_time": "2014-07-10T03:32:11", "url": "https://files.pythonhosted.org/packages/04/ff/df1b73a1ef01aecc1208718fc373493619b9aa12a11fdf6e1696880cf556/p01.elasticstub-0.5.3.zip" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "8db72c8f102b0b11713ebb2d4f2d0f48", "sha256": "c1b05f2fee640a435677f28b05d958776fba10f3da57c7e4da490e455370024e" }, "downloads": -1, "filename": "p01.elasticstub-0.5.4.tar.gz", "has_sig": false, "md5_digest": "8db72c8f102b0b11713ebb2d4f2d0f48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36431, "upload_time": "2017-11-02T11:26:23", "url": "https://files.pythonhosted.org/packages/04/f6/a03cd2334f6c9de5a046078f7228a8da6496194fdbeae3a51c3a30945e45/p01.elasticstub-0.5.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8db72c8f102b0b11713ebb2d4f2d0f48", "sha256": "c1b05f2fee640a435677f28b05d958776fba10f3da57c7e4da490e455370024e" }, "downloads": -1, "filename": "p01.elasticstub-0.5.4.tar.gz", "has_sig": false, "md5_digest": "8db72c8f102b0b11713ebb2d4f2d0f48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36431, "upload_time": "2017-11-02T11:26:23", "url": "https://files.pythonhosted.org/packages/04/f6/a03cd2334f6c9de5a046078f7228a8da6496194fdbeae3a51c3a30945e45/p01.elasticstub-0.5.4.tar.gz" } ] }