[Zope3-checkins] CVS: Zope3/src/zope/app/tests - test_clipboard.py:1.1.2.2

Sidnei da Silva sidnei@x3ng.com.br
Wed, 5 Feb 2003 07:43:08 -0500


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

Modified Files:
      Tag: paris-copypasterename-branch
	test_clipboard.py 
Log Message:
Trying to get physically located :P

=== Zope3/src/zope/app/tests/test_clipboard.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/tests/test_clipboard.py:1.1.2.1	Wed Feb  5 05:09:24 2003
+++ Zope3/src/zope/app/tests/test_clipboard.py	Wed Feb  5 07:43:04 2003
@@ -17,22 +17,25 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.interfaces.copy import IAnnotatableUserClipboard
-from zope.app.copy import AnnotatableUserClipboard
+from zope.app.interfaces.copy import IPrincipalClipboard
+from zope.app.copy import PrincipalClipboard
 from zope.app.interfaces.services.auth import IUser
 from zope.component import getAdapter
 from zope.component.adapter import provideAdapter
 
-class AnnotatableUserClipboardTest(AuthSetup, TestCase):
+class PrincipalClipboardTest(AuthSetup, TestCase):
     
     def setUp(self):
         AuthSetup.setUp(self)
-        provideAdapter(IUser, IAnnotatableUserClipboard, AnnotatableUserClipboard)
+        provideAdapter(IUser, IPrincipalClipboard, PrincipalClipboard)
 
     def testAddItems(self):
         auth = self._auth
         user = auth.getPrincipalByLogin('srichter')
-        clipboard = getAdapter(user, IAnnotatableUserClipboard)
+
+        annotationsvc = getService(self.context, 'PrincipalAnnotation')
+        annotations = annotationsvc.getAnnotation(user)
+        clipboard = getAdapter(annotations, IPrincipalClipboard)
         clipboard.addItems('move', ['bla', 'bla/foo', 'bla/bar'])
         expected = ({'action':'move', 'target':'bla'}, 
                     {'action':'move', 'target':'bla/foo'},
@@ -46,7 +49,11 @@
     def testSetContents(self):
         auth = self._auth
         user = auth.getPrincipalByLogin('srichter')
-        clipboard = getAdapter(user, IAnnotatableUserClipboard)
+
+        annotationsvc = getService(self.context, 'PrincipalAnnotation')
+        annotations = annotationsvc.getAnnotation(user)
+        clipboard = getAdapter(annotations, IPrincipalClipboard)
+
         expected = ({'action':'move', 'target':'bla'}, 
                     {'action':'move', 'target':'bla/foo'},
                     {'action':'move', 'target':'bla/bar'})
@@ -59,7 +66,9 @@
     def testClearContents(self):
         auth = self._auth
         user = auth.getPrincipalByLogin('srichter')
-        clipboard = getAdapter(user, IAnnotatableUserClipboard)
+        annotationsvc = getService(self.context, 'PrincipalAnnotation')
+        annotations = annotationsvc.getAnnotation(user)
+        clipboard = getAdapter(annotations, IPrincipalClipboard)
         clipboard.clearContents()
         self.failUnless(clipboard.getContents() == ())