[Zope3-checkins] CVS: Zope3/src/zope/app/container/tests - test_objectcopier.py:1.5 test_objectmover.py:1.4
Sidnei da Silva
sidnei@x3ng.com.br
Sun, 30 Mar 2003 11:22:32 -0500
Update of /cvs-repository/Zope3/src/zope/app/container/tests
In directory cvs.zope.org:/tmp/cvs-serv23899/src/zope/app/container/tests
Modified Files:
test_objectcopier.py test_objectmover.py
Log Message:
Adding a few more tests for ObjectCopier/Mover
=== Zope3/src/zope/app/container/tests/test_objectcopier.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/container/tests/test_objectcopier.py:1.4 Mon Feb 17 10:10:40 2003
+++ Zope3/src/zope/app/container/tests/test_objectcopier.py Sun Mar 30 11:22:32 2003
@@ -123,6 +123,46 @@
copier = getAdapter(file, IObjectCopier)
self.failUnless(copier.copyableTo(container, 'file1'))
+ def test_copyfoldertosibling(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2')
+ source = traverse(root, '/folder1/folder1_1')
+ copier = getAdapter(source, IObjectCopier)
+ copier.copyTo(target)
+ self.failUnless('folder1_1' in target)
+
+ def test_copyfoldertosame(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder1')
+ source = traverse(root, '/folder1/folder1_1')
+ copier = getAdapter(source, IObjectCopier)
+ copier.copyTo(target)
+ self.failUnless('folder1_1' in target)
+
+ def test_copyfoldertosame2(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder1/folder1_1')
+ source = traverse(root, '/folder1/folder1_1/folder1_1_1')
+ copier = getAdapter(source, IObjectCopier)
+ copier.copyTo(target)
+ self.failUnless('folder1_1_1' in target)
+
+ def test_copyfolderfromroot(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2')
+ source = traverse(root, '/folder1')
+ copier = getAdapter(source, IObjectCopier)
+ copier.copyTo(target)
+ self.failUnless('folder1' in target)
+
+ def test_copyfolderfromroot2(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2/folder2_1/folder2_1_1')
+ source = traverse(root, '/folder1')
+ copier = getAdapter(source, IObjectCopier)
+ copier.copyTo(target)
+ self.failUnless('folder1' in target)
+
def test_suite():
return TestSuite((
makeSuite(ObjectCopierTest),
=== Zope3/src/zope/app/container/tests/test_objectmover.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/container/tests/test_objectmover.py:1.3 Mon Feb 17 10:10:40 2003
+++ Zope3/src/zope/app/container/tests/test_objectmover.py Sun Mar 30 11:22:32 2003
@@ -118,6 +118,47 @@
file = traverse(root, 'folder1/file1')
mover = getAdapter(file, IObjectMover)
self.failUnless(mover.moveableTo(container, 'file1'))
+
+ def test_movefoldertosibling(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2')
+ source = traverse(root, '/folder1/folder1_1')
+ mover = getAdapter(source, IObjectMover)
+ mover.moveTo(target)
+ self.failUnless('folder1_1' in target)
+
+ def test_movefoldertosame(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder1')
+ source = traverse(root, '/folder1/folder1_1')
+ mover = getAdapter(source, IObjectMover)
+ mover.moveTo(target)
+ self.failUnless('folder1_1' in target)
+
+ def test_movefoldertosame2(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder1/folder1_1')
+ source = traverse(root, '/folder1/folder1_1/folder1_1_1')
+ mover = getAdapter(source, IObjectMover)
+ mover.moveTo(target)
+ self.failUnless('folder1_1_1' in target)
+
+ def test_movefolderfromroot(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2')
+ source = traverse(root, '/folder1')
+ mover = getAdapter(source, IObjectMover)
+ mover.moveTo(target)
+ self.failUnless('folder1' in target)
+
+ def test_movefolderfromroot2(self):
+ root = self.rootFolder
+ target = traverse(root, '/folder2/folder2_1/folder2_1_1')
+ source = traverse(root, '/folder1')
+ mover = getAdapter(source, IObjectMover)
+ mover.moveTo(target)
+ self.failUnless('folder1' in target)
+
def test_suite():
return TestSuite((