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)
def test_get_set_non_ascii_value(): client = MockMemcacheClient() assert client.get(b"hello") is None # This is the value of msgpack.packb('non_ascii') non_ascii_str = b"\xa9non_ascii" client.set(b"hello", non_ascii_str) assert client.get(b"hello") == non_ascii_str
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)
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
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)
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
def test_get_set_non_ascii_value(): client = MockMemcacheClient() assert client.get(b"hello") is None # This is the value of msgpack.packb('non_ascii') non_ascii_str = b'\xa9non_ascii' client.set(b"hello", non_ascii_str) assert client.get(b"hello") == non_ascii_str
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)
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)
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
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)
def test_prepand_append(): client = MockMemcacheClient() client.set(b"k", '1') client.append(b"k", 'a') client.prepend(b"k", 'p') assert client.get(b"k") == b'p1a'
def test_prepand_append(): client = MockMemcacheClient() client.set(b"k", "1") client.append(b"k", "a") client.prepend(b"k", "p") assert client.get(b"k") == b"p1a"
def test_get_set(): client = MockMemcacheClient() assert client.get(b"hello") is None client.set(b"hello", 12) assert client.get(b"hello") == 12
def test_get_set(): client = MockMemcacheClient() tools.assert_equal(client.get("hello"), None) client.set("hello", 12) tools.assert_equal(client.get("hello"), 12)
def test_get_set(): client = MockMemcacheClient() tools.assert_equal(client.get(b"hello"), None) client.set(b"hello", 12) tools.assert_equal(client.get(b"hello"), 12)