Exemplo n.º 1
0
def test_dict_merge():
    a = {"a": 1}
    b = {"b": 2}
    c = {"c": 3}
    assert dict_merge(a, b, c) == {"a": 1, "b": 2, "c": 3}

    with pytest.raises(AssertionError):
        dict_merge([])
Exemplo n.º 2
0
def test_dict_merge():
    a = {"a": 1}
    b = {"b": 2}
    c = {"c": 3}
    assert dict_merge(a, b, c) == {"a": 1, "b": 2, "c": 3}

    with pytest.raises(AssertionError):
        dict_merge([])
    def test_response_callbacks(self, r):
        all_response_callbacks = dict_merge(
            rediscluster.RedisCluster.RESPONSE_CALLBACKS,
            rediscluster.RedisCluster.CLUSTER_COMMANDS_RESPONSE_CALLBACKS,
        )

        assert r.response_callbacks == all_response_callbacks
        assert id(r.response_callbacks) != id(all_response_callbacks)
        r.set_response_callback('GET', lambda x: 'static')
        r['a'] = 'foo'
        assert r['a'] == 'static'
Exemplo n.º 4
0
def test_dict_merge_value_error():
    with pytest.raises(ValueError):
        dict_merge([])
Exemplo n.º 5
0
def test_dict_merge():
    a = {"a": 1}
    b = {"b": 2}
    c = {"c": 3}
    assert dict_merge(a, b, c) == {"a": 1, "b": 2, "c": 3}
Exemplo n.º 6
0
def test_dict_merge_value_error():
    with pytest.raises(ValueError):
        dict_merge([])
Exemplo n.º 7
0
def test_dict_merge():
    a = {"a": 1}
    b = {"b": 2}
    c = {"c": 3}
    assert dict_merge(a, b, c) == {"a": 1, "b": 2, "c": 3}