[Zope-CVS] CVS: Packages/JobBoardEx/tests - testJobList.py:1.7

Jim Fulton jim@zope.com
Tue, 11 Jun 2002 19:14:51 -0400

Update of /cvs-repository/Packages/JobBoardEx/tests
In directory cvs.zope.org:/tmp/cvs-serv10222/tests

Modified Files:
Log Message:
Refactored JobList to use __getitem__ rather than lookup.

This allowed is to assert that JobList implemented IItemContainer,
which got us a traverser. We made this assertion in the zcml file so
as not to much up the IJobList interface.

Also added a defaultView directive to mark index.html as JobLists
default view.

=== Packages/JobBoardEx/tests/testJobList.py 1.6 => 1.7 ===
         j1 = Job("foo")
-        self.assertEqual(j1, self.list.lookup(j1.id))
-        self.assertRaises(KeyError, self.list.lookup, j1.id+1)
+        self.assertEqual(j1, self.list[j1.id])
+        self.assertRaises(KeyError, self.list.__getitem__, j1.id+1)
 def test_suite():
     return unittest.makeSuite(JobListTests)