[Zope-CVS] CVS: Products/Basket/tests - testBasket.py:1.23

Chris McDonough chrism at plope.com
Wed Nov 9 22:13:53 EST 2005


Update of /cvs-repository/Products/Basket/tests
In directory cvs.zope.org:/tmp/cvs-serv18147/tests

Modified Files:
	testBasket.py 
Log Message:
Complain if the explicit egg requirement isn't really a Zope product.


=== Products/Basket/tests/testBasket.py 1.22 => 1.23 ===
--- Products/Basket/tests/testBasket.py:1.22	Wed Nov  9 20:18:34 2005
+++ Products/Basket/tests/testBasket.py	Wed Nov  9 22:13:53 2005
@@ -288,6 +288,24 @@
         actual = [ dist.key for dist in distributions if dist.key in expected ]
         self.assertEqual(sorted(expected), sorted(actual))
 
+    def test_product_distribution_not_a_zope_product(self):
+        basket = self._makeOne()
+        basket.pre_initialized = True
+
+        sys.path.append(self.fixtures)
+        self.working_set.add_entry(self.fixtures)
+
+        self._catch_log_errors(zLOG.ERROR)
+        try:
+            basket.require('notazopeproduct')
+        finally:
+            self._ignore_log_errors()
+
+        self.assertEqual(len(self.logged), 1)
+        warning = self.logged[0]
+        self.assertEqual(warning[1], zLOG.ERROR)
+        self.failUnless(warning[2].startswith('A requirement'))
+
     def test_preinitalize_pdist_file_success(self):
         basket = self._makeOne()
         sys.path.append(self.fixtures)



More information about the Zope-CVS mailing list