def test_iter(self):
        prio_set_list = event._PrioritizedSetList()
        objs = [(i,) for i in range(5)]
        for i, obj in enumerate(objs):
            prio_set_list.add(-i, obj)

        for i, set_ in enumerate(prio_set_list):
            assert set_ == (-i, {objs[i]})
def test_filter_factory(self):
        factory = memcache.filter_factory({'max_connections': '3'},
                                          memcache_servers='10.10.10.10:10',
                                          memcache_serialization_support='1')
        thefilter = factory('myapp')
        self.assertEqual(thefilter.app, 'myapp')
        self.assertEqual(thefilter.memcache_servers, '10.10.10.10:10')
        self.assertEqual(thefilter.memcache._allow_pickle, False)
        self.assertEqual(thefilter.memcache._allow_unpickle, True)
        self.assertEqual(
            thefilter.memcache._client_cache['10.10.10.10:10'].max_size, 3)