CVS: Products/Basket/tests - testBasket.py:1.20

Chris McDonough <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Update of /cvs-repository/Products/Basket/tests
In directory cvs.zope.org:/tmp/cvs-serv9534/tests

Modified Files:
	testBasket.py 
Log Message:
Add docs, create VERSION.txt, monkey-patch sys.modules['pkg_resources'] so Basket package authors don't need to import anything from Basket.



=== Products/Basket/tests/testBasket.py 1.19 => 1.20 ===
--- Products/Basket/tests/testBasket.py:1.19	Wed Nov  9 18:22:28 2005
+++ Products/Basket/tests/testBasket.py	Wed Nov  9 19:00:41 2005
@@ -5,7 +5,7 @@
 import Products
 from Products.Basket.utils import EggProductContext
 from Products.Basket import get_containing_package
-from Products.Basket import pkg_resources
+import pkg_resources # must come after some import of something in Basket
 from OFS.ObjectManager import ObjectManager
 from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder
@@ -128,6 +128,11 @@
     def _makeOne(self, *arg, **kw):
         klass = self._getTargetClass()
         return klass(*arg, **kw)
+
+    def test_pkg_resources_monkeypatch(self):
+        self.assertEqual(sys.modules['pkg_resources'],
+                         sys.modules['Basket.pkg_resources'],
+                         sys.modules['Products.Basket.pkg_resources'])
 
     def test_require_success(self):
         basket = self._makeOne()

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.