[Zope-CVS] SVN: zversioning/trunk/src/versioning/tests/README.txt
Reference example works now.
Uwe Oestermeier
uwe_oestermeier at iwm-kmrc.de
Sun Oct 10 08:39:36 EDT 2004
Log message for revision 27891:
Reference example works now.
Changed:
U zversioning/trunk/src/versioning/tests/README.txt
-=-
Modified: zversioning/trunk/src/versioning/tests/README.txt
===================================================================
--- zversioning/trunk/src/versioning/tests/README.txt 2004-10-10 12:26:07 UTC (rev 27890)
+++ zversioning/trunk/src/versioning/tests/README.txt 2004-10-10 12:39:36 UTC (rev 27891)
@@ -16,16 +16,23 @@
>>> from zope.interface import directlyProvides
>>> from zope.app.versioncontrol.repository import declare_versioned
>>> from versioning.tests.repository_setup import registerAdapter
- >>> from zope.app.location.location import Location
+ >>> from zope.app.folder import Folder, rootFolder
>>> from zope.app.tests.setup import setUpTraversal
-
+ >>> from zope.app.traversing.interfaces import IPhysicallyLocatable
+ >>> from ZODB.tests import util
+ >>> from zope.app.versioncontrol.interfaces import IVersioned
>>> registerAdapter()
>>> setUpTraversal()
- >>> sample = Location()
+ >>> class TestFolder(Folder) :
+ ... zope.interface.implements(IPhysicallyLocatable)
+ ... def getPath(self) :
+ ... return ""
+
+ >>> sample = TestFolder()
>>> directlyProvides(sample, zope.app.traversing.interfaces.IContainmentRoot)
- >>> a = sample["a"] = Location()
- >>> b = sample["b"] = Location()
- >>> c = b["c"] = Location()
+ >>> a = sample["a"] = TestFolder()
+ >>> b = sample["b"] = TestFolder()
+ >>> c = b["c"] = TestFolder()
>>> for x in (sample, a, b, c) :
... directlyProvides(x, zope.app.versioncontrol.interfaces.IVersionable)
@@ -66,7 +73,7 @@
>>> repository.applyVersionControl(b)
>>> repository.applyVersionControl(c)
>>> util.commit()
- >>> [x for interfaces.IVersioned.providedBy(x) in (sample, a, b, c)]
+ >>> [IVersioned.providedBy(x) for x in (sample, a, b, c)]
[True, True, True, True]
@@ -76,11 +83,12 @@
its reference to a because c is not contained in a. (See
zope.app.versioncontrol.version.cloneByPickle)
- >>> a_info = repository.getVersionInfo(a)
- >>> a_version = a_info._data
- >>> c_info = repository.getVersionInfo(c)
- >>> c_version = c_info._data
- >>> c_version.refers_to == a_version
+ >>> def accessVersion(repository, obj) :
+ ... info = repository.getVersionInfo(obj)
+ ... return repository.getVersionOfResource(info.history_id, 'mainline')
+ >>> new_a = accessVersion(repository, a)
+ >>> new_c = accessVersion(repository, c)
+ >>> new_c.refers_to == new_a
False
More information about the Zope-CVS
mailing list