[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools/tests - test_dependencies.py:1.3

Fred L. Drake, Jr. fred at zope.com
Mon Mar 29 11:50:59 EST 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools/tests
In directory cvs.zope.org:/tmp/cvs-serv7071/tests

Modified Files:
	test_dependencies.py 
Log Message:
- make the dependencies support play the same typing dance as everything else
- check package: dependencies and locations for legal pakcage names


=== Packages/zpkgtools/zpkgtools/tests/test_dependencies.py 1.2 => 1.3 ===
--- Packages/zpkgtools/zpkgtools/tests/test_dependencies.py:1.2	Wed Mar 17 11:42:24 2004
+++ Packages/zpkgtools/zpkgtools/tests/test_dependencies.py	Mon Mar 29 11:50:59 2004
@@ -25,8 +25,7 @@
     def test_empty_file(self):
         sio = StringIO("")
         deps = dependencies.load(sio)
-        self.assert_(not deps.packages)
-        self.assert_(not deps.others)
+        self.assert_(not deps)
 
     def test_empty_file_with_comments(self):
         sio = StringIO("""\
@@ -34,8 +33,7 @@
             # So is this.
             """)
         deps = dependencies.load(sio)
-        self.assert_(not deps.packages)
-        self.assert_(not deps.others)
+        self.assert_(not deps)
 
     def test_just_packages(self):
         sio = StringIO("""\
@@ -43,37 +41,34 @@
             zope.app.bar
             """)
         deps = dependencies.load(sio)
-        self.assertEqual(len(deps.packages), 2)
-        self.assert_("zope.foo" in deps.packages)
-        self.assert_("zope.app.bar" in deps.packages)
-        self.assert_(not deps.others)
+        self.assertEqual(len(deps), 2)
+        self.assert_("package:zope.foo" in deps)
+        self.assert_("package:zope.app.bar" in deps)
 
     def test_just_others(self):
         sio = StringIO("""\
-            not-a-module
+            feature:not-a-module
             feature:zope.bar
             """)
         deps = dependencies.load(sio)
-        self.assert_(not deps.packages)
-        self.assertEqual(len(deps.others), 2)
-        self.assert_("not-a-module" in deps.others)
-        self.assert_("feature:zope.bar" in deps.others)
+        self.assertEqual(len(deps), 2)
+        self.assert_("feature:not-a-module" in deps)
+        self.assert_("feature:zope.bar" in deps)
 
     def test_packages_and_others(self):
         sio = StringIO("""\
-            not-a-module
+            feature:not-a-module
             zope.foo
             # Comments can go here
             zope.app.bar
             feature:zope.bar
             """)
         deps = dependencies.load(sio)
-        self.assertEqual(len(deps.packages), 2)
-        self.assert_("zope.foo" in deps.packages)
-        self.assert_("zope.app.bar" in deps.packages)
-        self.assertEqual(len(deps.others), 2)
-        self.assert_("not-a-module" in deps.others)
-        self.assert_("feature:zope.bar" in deps.others)
+        self.assertEqual(len(deps), 4)
+        self.assert_("package:zope.foo" in deps)
+        self.assert_("package:zope.app.bar" in deps)
+        self.assert_("feature:not-a-module" in deps)
+        self.assert_("feature:zope.bar" in deps)
 
     def test_blank_line_ends_data(self):
         sio = StringIO("""\
@@ -85,12 +80,10 @@
             zope.yeahright
             """)
         deps = dependencies.load(sio)
-        self.assertEqual(len(deps.packages), 2)
-        self.assertEqual(len(deps.others), 1)
-        self.assert_("feature:but-not-really" not in deps.packages)
-        self.assert_("feature:but-not-really" not in deps.others)
-        self.assert_("zope.yeahright" not in deps.packages)
-        self.assert_("zope.yeahright" not in deps.others)
+        self.assertEqual(len(deps), 3)
+        self.assert_("feature:foo" in deps)
+        self.assert_("package:zope.app" in deps)
+        self.assert_("package:zope.schema" in deps)
 
 
 def test_suite():




More information about the Zope-CVS mailing list