Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
Set a `value` for the `key`. If `append` is ``True`` the value will be added
to other values for this `key`.

If `unpack` is True, `value` will be unpacked and each item will be added.

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_request.py   MapProxy(Download)
    def test_set(self):
        nc_dict = NoCaseMultiDict()
        nc_dict.set('foo', 'bar')
        assert nc_dict.get_all('fOO') == ['bar']
        nc_dict.set('fOo', 'buzz', append=True)
        assert nc_dict.get_all('FOO') == ['bar', 'buzz']
        nc_dict.set('foO', 'bizz')
        assert nc_dict.get_all('FOO') == ['bizz']
        nc_dict.set('foO', ['ham', 'spam'], unpack=True)
        nc_dict.set('foO', ['ham', 'spam'], unpack=True)
        assert nc_dict.get_all('FOO') == ['ham', 'spam']
        nc_dict.set('FoO', ['egg', 'bacon'], append=True, unpack=True)
        assert nc_dict.get_all('FOo') == ['ham', 'spam', 'egg', 'bacon']
 

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_request.py   mapproxy(Download)
    def test_set(self):
        nc_dict = NoCaseMultiDict()
        nc_dict.set('foo', 'bar')
        assert nc_dict.get_all('fOO') == ['bar']
        nc_dict.set('fOo', 'buzz', append=True)
        assert nc_dict.get_all('FOO') == ['bar', 'buzz']
        nc_dict.set('foO', 'bizz')
        assert nc_dict.get_all('FOO') == ['bizz']
        nc_dict.set('foO', ['ham', 'spam'], unpack=True)
        nc_dict.set('foO', ['ham', 'spam'], unpack=True)
        assert nc_dict.get_all('FOO') == ['ham', 'spam']
        nc_dict.set('FoO', ['egg', 'bacon'], append=True, unpack=True)
        assert nc_dict.get_all('FOo') == ['ham', 'spam', 'egg', 'bacon']