diff options
| author | Ross Patterson <me@rpatterson.net> | 2012-08-01 04:13:02 +0000 |
|---|---|---|
| committer | Ross Patterson <me@rpatterson.net> | 2012-08-01 04:13:02 +0000 |
| commit | 54dabb0a1657550559dcf39e463be72e1a554bcd (patch) | |
| tree | bb8482a85471d8098622e231d9d8f62f01e588c8 /src/zope/component/tests | |
| parent | cb48390f01d55041ec2249752cce4b461447d1b7 (diff) | |
| download | zope-component-54dabb0a1657550559dcf39e463be72e1a554bcd.tar.gz | |
Don't pickle registry flattened bases in the 'ro' attribute.
This avoids pickle references that are redundant with the '__bases__'
pickling.
Diffstat (limited to 'src/zope/component/tests')
| -rw-r--r-- | src/zope/component/tests/test_persistentregistry.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/zope/component/tests/test_persistentregistry.py b/src/zope/component/tests/test_persistentregistry.py index e98277a..e39f537 100644 --- a/src/zope/component/tests/test_persistentregistry.py +++ b/src/zope/component/tests/test_persistentregistry.py @@ -96,7 +96,7 @@ class PersistentAdapterRegistryTests(unittest.TestCase): self.assertEqual(state['_provided'], {}) self.assertEqual(state['_adapters'], []) self.assertEqual(state['_subscribers'], []) - self.assertEqual(state['ro'], [registry] + list(bases)) + self.assertNotIn('ro', state) def test___getstate___skips_delegated_names(self): registry, jar, OID = self._makeOneWithJar() @@ -112,6 +112,15 @@ class PersistentAdapterRegistryTests(unittest.TestCase): registry.__setstate__(state) self.assertTrue('_v_lookup' in registry.__dict__) + def test___setstate___rebuilds__ro(self): + from zope.component import globalSiteManager + bases = (globalSiteManager.adapters, globalSiteManager.utilities) + registry, jar, OID = self._makeOneWithJar(bases=bases) + state = registry.__getstate__() + registry.__setstate__(state) + self.assertEqual(registry.__bases__, bases) + self.assertEqual(registry.ro, [registry] + list(bases)) + class PersistentComponentsTests(unittest.TestCase): |
