How to use the multidict.MutableMultiMapping function in multidict

To help you get started, weโ€™ve selected a few multidict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / multidict / tests / test_abc.py View on Github external
def test_abc_inheritance():
    assert issubclass(MultiMapping, Mapping)
    assert not issubclass(MultiMapping, MutableMapping)
    assert issubclass(MutableMultiMapping, Mapping)
    assert issubclass(MutableMultiMapping, MutableMapping)
github aio-libs / multidict / tests / test_abc.py View on Github external
def getone(self, key, default=None):
        super().getone(key, default)


def test_abc_getall():
    with pytest.raises(KeyError):
        A().getall("key")


def test_abc_getone():
    with pytest.raises(KeyError):
        A().getone("key")


class B(A, MutableMultiMapping):
    def __setitem__(self, key, value):
        pass

    def __delitem__(self, key):
        pass

    def add(self, key, value):
        super().add(key, value)

    def extend(self, *args, **kwargs):
        super().extend(*args, **kwargs)

    def popall(self, key, default=None):
        super().popall(key, default)

    def popone(self, key, default=None):
github aio-libs / multidict / tests / test_abc.py View on Github external
def test_proxy_inheritance(proxy_classes):
    proxy, _ = proxy_classes
    assert issubclass(proxy, MultiMapping)
    assert not issubclass(proxy, MutableMultiMapping)