[Checkins] SVN: zope.location/trunk/ Moved LocationCopyHook related tests to zope.copy and remove a test dependency on that package.

Hanno Schlichting hannosch at hannosch.eu
Tue Dec 29 17:47:42 EST 2009


Log message for revision 107320:
  Moved LocationCopyHook related tests to zope.copy and remove a test dependency on that package.
  

Changed:
  U   zope.location/trunk/CHANGES.txt
  U   zope.location/trunk/buildout.cfg
  U   zope.location/trunk/setup.py
  U   zope.location/trunk/src/zope/location/pickling.py
  U   zope.location/trunk/src/zope/location/tests.py

-=-
Modified: zope.location/trunk/CHANGES.txt
===================================================================
--- zope.location/trunk/CHANGES.txt	2009-12-29 22:42:30 UTC (rev 107319)
+++ zope.location/trunk/CHANGES.txt	2009-12-29 22:47:42 UTC (rev 107320)
@@ -2,10 +2,11 @@
 CHANGES
 =======
 
-3.8.3 (unreleased)
+3.9.0 (unreleased)
 ------------------
 
-- ...
+- Moved LocationCopyHook related tests to zope.copy and remove a test
+  dependency on that package.
 
 3.8.2 (2009-12-23)
 ------------------

Modified: zope.location/trunk/buildout.cfg
===================================================================
--- zope.location/trunk/buildout.cfg	2009-12-29 22:42:30 UTC (rev 107319)
+++ zope.location/trunk/buildout.cfg	2009-12-29 22:47:42 UTC (rev 107320)
@@ -4,11 +4,11 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zope.location [test]
+eggs = zope.location
 
 [coverage-test]
 recipe = zc.recipe.testrunner
-eggs = zope.location [test]
+eggs = zope.location
 defaults = ['--coverage', '../../coverage']
 
 [coverage-report]

Modified: zope.location/trunk/setup.py
===================================================================
--- zope.location/trunk/setup.py	2009-12-29 22:42:30 UTC (rev 107319)
+++ zope.location/trunk/setup.py	2009-12-29 22:47:42 UTC (rev 107320)
@@ -26,7 +26,7 @@
     return text
 
 setup(name='zope.location',
-      version = '3.8.3dev',
+      version = '3.9.0dev',
       author='Zope Corporation and Contributors',
       author_email='zope-dev at zope.org',
       description='Zope Location',
@@ -41,7 +41,7 @@
           read('CHANGES.txt')
           ),
       license='ZPL 2.1',
-      keywords=('zope3 location structural'),
+      keywords=('zope location structural'),
       classifiers = [
           'Development Status :: 5 - Production/Stable',
           'Environment :: Web Environment',
@@ -56,14 +56,12 @@
       packages=find_packages('src'),
       package_dir = {'': 'src'},
       namespace_packages=['zope',],
-      tests_require=['zope.copy'],
       install_requires=['setuptools',
                         'zope.interface',
                         'zope.schema>=3.5.1dev',
                         'zope.component>=3.8.0',
                         'zope.proxy>3.3',
                         ],
-      extras_require=dict(test=['zope.copy']),
       include_package_data = True,
       zip_safe = False,
       )

Modified: zope.location/trunk/src/zope/location/pickling.py
===================================================================
--- zope.location/trunk/src/zope/location/pickling.py	2009-12-29 22:42:30 UTC (rev 107319)
+++ zope.location/trunk/src/zope/location/pickling.py	2009-12-29 22:47:42 UTC (rev 107320)
@@ -32,37 +32,6 @@
 class LocationCopyHook(object):
     """Copy hook to preserve copying referenced objects that are not
     located inside object that's being copied.
-
-    To see the problem, imagine we want to copy an ILocation object that
-    contains an attribute-based reference to another ILocation object
-    and the referenced object is not contained inside object being copied. 
-    
-    Without this hook, the referenced object will be cloned:
-    
-    >>> from zope.location.location import Location, locate
-    >>> root = Location()
-    >>> page = Location()
-    >>> locate(page, root, 'page')
-    >>> image = Location()
-    >>> locate(page, root, 'image')
-    >>> page.thumbnail = image
-    
-    >>> from zope.copy import copy
-    >>> page_copy = copy(page)
-    >>> page_copy.thumbnail is image
-    False
-
-    But if we will provide a hook, the attribute will point to the
-    original object as we might want.
-
-    >>> from zope.component import provideAdapter
-    >>> provideAdapter(LocationCopyHook)
-
-    >>> from zope.copy import copy
-    >>> page_copy = copy(page)
-    >>> page_copy.thumbnail is image
-    True
-    
     """
     
     adapts(ILocation)

Modified: zope.location/trunk/src/zope/location/tests.py
===================================================================
--- zope.location/trunk/src/zope/location/tests.py	2009-12-29 22:42:30 UTC (rev 107319)
+++ zope.location/trunk/src/zope/location/tests.py	2009-12-29 22:47:42 UTC (rev 107320)
@@ -24,5 +24,4 @@
     return unittest.TestSuite((
         doctest.DocFileSuite('location.txt'),
         doctest.DocTestSuite('zope.location.traversing'),
-        doctest.DocTestSuite('zope.location.pickling'),
     ))



More information about the checkins mailing list