[Zope3-checkins] CVS: Zope3/src/zope/app/container/tests - test_objectmover.py:1.6.24.4

Jim Fulton jim at zope.com
Mon Sep 15 14:13:01 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/container/tests
In directory cvs.zope.org:/tmp/cvs-serv15511/src/zope/app/container/tests

Modified Files:
      Tag: parentgeddon-branch
	test_objectmover.py 
Log Message:
Got lots of tests to pass.

Added a setitem helper function to be used to help satisfy container
contracts.



=== Zope3/src/zope/app/container/tests/test_objectmover.py 1.6.24.3 => 1.6.24.4 ===
--- Zope3/src/zope/app/container/tests/test_objectmover.py:1.6.24.3	Fri Sep 12 17:22:35 2003
+++ Zope3/src/zope/app/container/tests/test_objectmover.py	Mon Sep 15 14:12:30 2003
@@ -35,13 +35,15 @@
         provideAdapter(None, IObjectMover, ObjectMover)
  
     def test_movetosame(self):
+        # Should be a noop, because "moving" to same location
         root = self.rootFolder
         container = traverse(root, 'folder1')
         container['file1'] = File()
         file = traverse(root, 'folder1/file1')
         mover = getAdapter(file, IObjectMover)
         mover.moveTo(container, 'file1')
-        self.failUnless('file1-2' in container)
+        self.failUnless('file1' in container)
+        self.assertEquals(len(container), 3)
 
     def test_movetosamewithnewname(self):
         root = self.rootFolder
@@ -115,20 +117,24 @@
         self.failUnless('folder1_1' in target)
 
     def test_movefoldertosame(self):
+        # Should be a noop, because "moving" to same location
         root = self.rootFolder
         target = traverse(root, '/folder1')
         source = traverse(root, '/folder1/folder1_1')
         mover = getAdapter(source, IObjectMover)
         mover.moveTo(target)
-        self.failUnless('folder1_1-2' in target)
+        self.failUnless('folder1_1' in target)
+        self.assertEquals(len(target), 2)
 
     def test_movefoldertosame2(self):
+        # Should be a noop, because "moving" to same location
         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-2' in target)
+        self.failUnless('folder1_1_1' in target)
+        self.assertEquals(len(target), 2)
 
     def test_movefolderfromroot(self):
         root = self.rootFolder




More information about the Zope3-Checkins mailing list