Example #1
0
def test_add():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    assert client.get(b"k") == 2

    client.add(b"k", 25)
    assert client.get(b"k") == 2
Example #2
0
def test_delete():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    assert client.get(b"k") == 2

    client.delete(b"k")
    assert client.get(b"k") is None
Example #3
0
def test_delete():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    tools.assert_equal(client.get(b"k"), 2)

    client.delete(b"k")
    tools.assert_equal(client.get(b"k"), None)
Example #4
0
def test_delete():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    assert client.get(b"k") == 2

    client.delete(b"k")
    assert client.get(b"k") is None
Example #5
0
def test_add():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    tools.assert_equal(client.get(b"k"), 2)

    client.add(b"k", 25)
    tools.assert_equal(client.get(b"k"), 2)
Example #6
0
def test_add():
    client = MockMemcacheClient()

    client.add(b"k", 2)
    assert client.get(b"k") == 2

    client.add(b"k", 25)
    assert client.get(b"k") == 2
Example #7
0
def test_delete():
    client = MockMemcacheClient()

    client.add("k", 2)
    tools.assert_equal(client.get("k"), 2)

    client.delete("k")
    tools.assert_equal(client.get("k"), None)
Example #8
0
def test_add():
    client = MockMemcacheClient()

    client.add("k", 2)
    tools.assert_equal(client.get("k"), 2)

    client.add("k", 25)
    tools.assert_equal(client.get("k"), 2)
Example #9
0
def test_incr_decr():
    client = MockMemcacheClient()

    client.add(b"k", 2)

    client.incr(b"k", 4)
    assert client.get(b"k") == 6

    client.decr(b"k", 2)
    assert client.get(b"k") == 4
Example #10
0
def test_incr_decr():
    client = MockMemcacheClient()

    client.add(b"k", 2)

    client.incr(b"k", 4)
    tools.assert_equal(client.get(b"k"), 6)

    client.decr(b"k", 2)
    tools.assert_equal(client.get(b"k"), 4)
Example #11
0
def test_incr_decr():
    client = MockMemcacheClient()

    client.add(b"k", 2)

    client.incr(b"k", 4)
    assert client.get(b"k") == 6

    client.decr(b"k", 2)
    assert client.get(b"k") == 4
Example #12
0
def test_incr_decr():
    client = MockMemcacheClient()

    client.add("k", 2)

    client.incr("k", 4)
    tools.assert_equal(client.get("k"), 6)

    client.decr("k", 2)
    tools.assert_equal(client.get("k"), 4)