Пример #1
0
def test_first_key():
    assert first_key("foobar", {"foo": 1}) == 1

    with pytest.raises(RedisClusterException) as ex:
        first_key("foobar", {"foo": 1, "bar": 2})
    assert unicode(
        ex.value).startswith("More then 1 result from command: foobar")
Пример #2
0
def test_first_key():
    assert first_key("foobar", {"foo": 1}) == 1

    with pytest.raises(RedisClusterException) as ex:
        first_key("foobar", {"foo": 1, "bar": 2})
    assert unicode(ex.value).startswith("More then 1 result from command: foobar")

    with pytest.raises(AssertionError):
        first_key("foobar", None)
Пример #3
0
def test_first_key_value_error():
    with pytest.raises(ValueError):
        first_key("foobar", None)
Пример #4
0
def test_first_key_value_error():
    with pytest.raises(ValueError):
        first_key("foobar", None)