File: test_monkey.py

package info (click to toggle)
python-uhashring 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 156 kB
  • sloc: python: 668; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 474 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
"""
"""

from uhashring import HashRing, monkey


def test_patch_memcache():
    """Returns if no memcache.

    NB:
        test key -> 11212
        zzzzzzzzzz key -> 11211
    """
    monkey.patch_memcache()

    import memcache

    mc = memcache.Client(["127.0.0.1:11211", "127.0.0.0:11212"])
    mc.set("zzzzzzzzzz", 1, 2)
    mc.get("zzzzzzzzzz")
    mc.get("test")
    mc.get((0, "zzzzzzzzzz"))

    assert isinstance(mc.uhashring, HashRing)