[Zope-CVS] SVN: zversioning/trunk/src/versioning/README.txt added
some tests
Grégoire Weber
zope.org at incept.ch
Wed Oct 13 13:17:22 EDT 2004
Log message for revision 28115:
added some tests
Changed:
U zversioning/trunk/src/versioning/README.txt
-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 17:14:34 UTC (rev 28114)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-13 17:17:20 UTC (rev 28115)
@@ -32,10 +32,9 @@
... directlyProvides(x, zope.app.versioncontrol.interfaces.IVersionable)
>>> [x for x in sample.keys()]
[u'a', u'b']
-
+
>>> from versioning.tests.test_versioncontrol import buildRepository, buildDatabaseRoot
>>> db_root = buildDatabaseRoot()
- >>> db_root["sample"] = sample
CopyModifyMergeRepository Setup Explained
@@ -106,6 +105,10 @@
>>> instanceProvides(b, interfaces.IVersionable)
>>> instanceProvides(c, interfaces.IVersionable)
+ >>> sample.text = "text version 1 of sample"
+ >>> a.text = "text version 1 of a"
+ >>> c.text = "text version 1 of a"
+
The chosen 'IHistoryStorage' component expects the objects having
a '_p_oid'.
XXX We know this is an implementation detail. We probably should think
@@ -122,13 +125,30 @@
>>> [interfaces.IVersioned.providedBy(x) for x in (sample, a, b, c)]
[True, True, True, True]
- #>>> repo.isCheckedOut(a)
+The example data must be now in checked in state:
+
+ #>>> repo.isCheckedOut(sample)
False
- #>>> #repo.checkout(a)
- #>>> #repo.isCheckedOut(a)
- True
-
+Let's have a look how 'checkout', 'checkin' and 'isCheckedOut' work
+together:
+ #>>> #repo.checkout(sample)
+ #>>> #repo.isCheckedOut(sample)
+ True
+
+The text shall be unchanged:
+
+ >>> sample.text
+ 'text version 1 of sample'
+
+We have a look if the version history grows with a checkin:
+
#>>> len(repo.getVersionHistory(sample))
1
+ >>> repo.checkout(sample)
+ >>> repo.text = 'text version 2 of sample'
+ >>> repo.checkin(sample)
+ #>>> len(repo.getVersionHistory(sample))
+ 2
+ >>>
\ No newline at end of file
More information about the Zope-CVS
mailing list