Esempio n. 1
0
def test_srem():
    ledis = Ledis()
    ledis.sadd("set_type", *{1, 2, 3})

    ledis.srem("set_type", *{2, 3})
    assert ledis.storage["set_type"].data == {1}
Esempio n. 2
0
def test_srem_str_value():
    ledis = Ledis()
    ledis.sadd("hello", 1, 2, 3)
    ledis.srem("hello", "world")

    assert ledis.storage["hello"] == Set({1, 2, 3})
Esempio n. 3
0
def test_srem_to_str():
    ledis = Ledis()
    ledis.set("hello", "world")

    with pytest.raises(InvalidType):
        ledis.srem("hello", {2, 3, 4})
Esempio n. 4
0
def test_srem_not_exist():
    ledis = Ledis()
    ledis.srem("set_type", *{1, 2, 3})