Python UserDict.IterableUserDict() Examples

The following are 3 code examples of UserDict.IterableUserDict(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module UserDict , or try the search function .
Example #1
Source File: test_record_dict.py    From n6 with GNU Affero General Public License v3.0 6 votes vote down vote up
def test__setitem__urls_matched(self):
        urls1 = ['http://żażółć.com/?=\xdd', u'ftp://foo/ł']
        cleaned_urls1 = [u'ftp://foo/ł', u'http://żażółć.com/?=\udcdd']
        urls2 = (10000 * 'u',)
        cleaned_urls2 = [10000 * u'u']
        self._test_setitem_valid('urls_matched', (
            S({u'o1': cleaned_urls1, u'o2': cleaned_urls2}, (
                {'o1': urls1, 'o2': urls2},
                {u'o1': urls1, 'o2': urls2},
                {u'o1': urls1, u'o2': urls2},
                IterableUserDict({'o1': urls1, u'o2': urls2}),
            )),
        ))
        self._test_setitem_adjuster_error('urls_matched', (
            {},
            IterableUserDict(),
            {'o1': urls1, 'o2': []},
            {'o1': urls1, 33 * 'o': urls2},
            {'o1': urls1, None: urls2},
            urls1,
            set({'foo', 'bar'}),
            123,
            None,
            datetime.datetime.now(),
        )) 
Example #2
Source File: app.py    From pydevp2p with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, config=default_config):
        self.config = utils.update_config_with_defaults(config, self.default_config)
        self.services = IterableUserDict() 
Example #3
Source File: urlfetch.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def __init__(self, dict=None, **kwargs):
    self.caseless_keys = {}
    UserDict.IterableUserDict.__init__(self, dict, **kwargs)