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

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-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)

_______________________________________________
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.