{ "info": { "author": "Hong Minhee ", "author_email": "dahlia@lunant.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing" ], "description": "The Python dictionary-based mock memcached client library. It does not\nconnect to any memcached server, but keeps a dictionary and stores every cache\ninto there internally. It is a just emulated API of memcached client only for\ntests. It implements expiration also. NOT THREAD-SAFE. ::\n\n try:\n import memcache\n except ImportError:\n import warnings\n import mockcache as memcache\n warnings.warn(\"imported mockcache instead of memcache; cannot find \"\n \"memcache module\")\n\n mc = memcache.Client([\"127.0.0.1:11211\"])\n\nThis module and other memcached client libraries have the same behavior.\n\n>>> from mockcache import Client\n>>> mc = Client()\n>>> mc\n\n>>> mc.get(\"a\")\n>>> mc.get(\"a\") is None\nTrue\n>>> mc.set(\"a\", \"1234\")\n1\n>>> mc.get(\"a\")\n'1234'\n>>> mc\n\n>>> mc.add(\"a\", \"1111\")\n0\n>>> mc.get(\"a\")\n'1234'\n>>> mc\n\n>>> mc.replace(\"a\", \"2222\")\n1\n>>> mc.get(\"a\")\n'2222'\n>>> mc\n\n>>> mc.append(\"a\", \"3\")\n1\n>>> mc.get(\"a\")\n'22223'\n>>> mc\n\n>>> mc.prepend(\"a\", \"1\")\n1\n>>> mc.get(\"a\")\n'122223'\n>>> mc\n\n>>> mc.incr(\"a\")\n122224\n>>> mc.get(\"a\")\n122224\n>>> mc\n\n>>> mc.incr(\"a\", 10)\n122234\n>>> mc.get(\"a\")\n122234\n>>> mc\n\n>>> mc.decr(\"a\")\n122233\n>>> mc.get(\"a\")\n122233\n>>> mc\n\n>>> mc.decr(\"a\", 5)\n122228\n>>> mc.get(\"a\")\n122228\n>>> mc\n\n>>> mc.replace(\"b\", \"value\")\n0\n>>> mc.get(\"b\")\n>>> mc.get(\"b\") is None\nTrue\n>>> mc\n\n>>> mc.add(\"b\", \"value\", 5)\n1\n>>> mc.get(\"b\")\n'value'\n>>> mc # doctest: +ELLIPSIS\n\n>>> import time\n>>> time.sleep(6)\n>>> mc.get(\"b\")\n>>> mc.get(\"b\") is None\nTrue\n>>> mc\n\n>>> mc.set(\"c\", \"value\")\n1\n>>> mc.get_multi([\"a\", \"b\", \"c\"])\n{'a': 122228, 'c': 'value'}\n>>> mc.set_multi({\"a\": 999, \"b\": 998, \"c\": 997}, key_prefix=\"pf_\")\n[]\n>>> mc.get(\"pf_a\")\n999\n>>> multi_result = mc.get_multi([\"b\", \"c\"], key_prefix=\"pf_\")\n>>> multi_result[\"b\"]\n998\n>>> multi_result[\"c\"]\n997\n>>> mc.delete(\"a\")\n1\n>>> mc.get(\"a\") is None\nTrue\n>>> mc.set(\"a b c\", 123) #doctest: +IGNORE_EXCEPTION_DETAIL\nTraceback (most recent call last):\nMockcachedKeyCharacterError: Control characters not allowed\n>>> mc.set(None, 123) #doctest: +IGNORE_EXCEPTION_DETAIL\nTraceback (most recent call last):\nMockcachedKeyNoneError: Key is None\n>>> mc.set(123, 123) #doctest: +IGNORE_EXCEPTION_DETAIL\nTraceback (most recent call last):\nMockcachedKeyTypeError: Key must be str()'s\n>>> mc.set(u\"a\", 123) #doctest: +IGNORE_EXCEPTION_DETAIL\nTraceback (most recent call last):\nMockcachedStringEncodingError: Key must be str()'s, not unicode.\n>>> mc.set(\"a\" * 251, 123) #doctest: +IGNORE_EXCEPTION_DETAIL\nTraceback (most recent call last):\nMockcachedKeyLengthError: Key length is > ...", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lunant/mockcache", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "mockcache", "package_url": "https://pypi.org/project/mockcache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mockcache/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/lunant/mockcache" }, "release_url": "https://pypi.org/project/mockcache/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "The Python dictionary-based mock memcached client library.", "version": "1.0.3" }, "last_serial": 1933292, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "768d3c3c257ad0cb8ca1ceef1d0c0be4", "sha256": "1791be66c2e03b6b025ed43b959ace6563b2703ed2c26077892f7a241743230f" }, "downloads": -1, "filename": "mockcache-0.9.tar.gz", "has_sig": false, "md5_digest": "768d3c3c257ad0cb8ca1ceef1d0c0be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3353, "upload_time": "2010-04-03T04:24:58", "url": "https://files.pythonhosted.org/packages/f1/5a/96eb084003db17c5c79d37f6294837398c2fc56b79d0d2f3de914e19cc5c/mockcache-0.9.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "49cd5d6761b588d3cc32997cc8c90d9d", "sha256": "ffa416b2ba58514becf75c4ee5b6e5c2e3b77aae070c6bb2919a196d19af4d0b" }, "downloads": -1, "filename": "mockcache-1.0.tar.gz", "has_sig": false, "md5_digest": "49cd5d6761b588d3cc32997cc8c90d9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3417, "upload_time": "2010-04-03T04:25:22", "url": "https://files.pythonhosted.org/packages/7a/99/ddd97d65080ba27bede15d71fa45eaba6e025909f8db365bf5ff04f0b848/mockcache-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f4d63806d6c1cce342b8b649b689f62f", "sha256": "064c4929d62ba02cfa22a223eabd35b99e877ace3ec6f3785cc66d7c5143435b" }, "downloads": -1, "filename": "mockcache-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f4d63806d6c1cce342b8b649b689f62f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3465, "upload_time": "2010-05-06T02:00:42", "url": "https://files.pythonhosted.org/packages/8b/01/25f3e402be85cf2c56a90d3563e071829ce3a6d813042b96f1ebde9984bb/mockcache-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "9bc912a40ccd21fa7f443e0f9621b6ab", "sha256": "f751a19690ef2301646d58a2d7513072a9c261dd4e0a5f3299ea5bb4688259be" }, "downloads": -1, "filename": "mockcache-1.0.2.tar.gz", "has_sig": true, "md5_digest": "9bc912a40ccd21fa7f443e0f9621b6ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4337, "upload_time": "2016-01-06T08:01:44", "url": "https://files.pythonhosted.org/packages/ab/7e/496cedd7b512fa82d1afa35291011e146f54478f292599e5e2a80bec68e3/mockcache-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "18e266040d9203117daad327bd4a3826", "sha256": "c637c35eaf0322f6c5fa6875a3fc5dc756514585a8b77abe4482d69bf364196d" }, "downloads": -1, "filename": "mockcache-1.0.3.tar.gz", "has_sig": true, "md5_digest": "18e266040d9203117daad327bd4a3826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4659, "upload_time": "2016-02-01T08:47:24", "url": "https://files.pythonhosted.org/packages/8f/8d/45e8a33605593796552cfc67b186539da9318f7f4fd40834d427a3537e6d/mockcache-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18e266040d9203117daad327bd4a3826", "sha256": "c637c35eaf0322f6c5fa6875a3fc5dc756514585a8b77abe4482d69bf364196d" }, "downloads": -1, "filename": "mockcache-1.0.3.tar.gz", "has_sig": true, "md5_digest": "18e266040d9203117daad327bd4a3826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4659, "upload_time": "2016-02-01T08:47:24", "url": "https://files.pythonhosted.org/packages/8f/8d/45e8a33605593796552cfc67b186539da9318f7f4fd40834d427a3537e6d/mockcache-1.0.3.tar.gz" } ] }