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

Guido van Rossum guido@python.org
Thu, 21 Mar 2002 13:10:29 -0500


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

Modified Files:
	testJobList.py 
Log Message:
Make the test suite work now that JobList.add() set job.id.


=== Packages/JobBoardEx/tests/testJobList.py 1.5 => 1.6 ===
 
 class Job:
-    def __init__(self, id, state):
+    def __init__(self, state):
         self.state = state
-        self.id = id
 
 class JobListTests(unittest.TestCase):
 
@@ -16,7 +15,7 @@
         self.list = JobList()
 
     def testBasicQuery(self):
-        j1 = Job(1, "foo")
+        j1 = Job("foo")
         self.list.add(j1)
         l = self.list.query("foo")
         self.assertEqual(l, [j1])
@@ -29,10 +28,10 @@
         verifyObject(IJobList, self.list)
 
     def testLookup(self):
-        j1 = Job(1, "foo")
+        j1 = Job("foo")
         self.list.add(j1)
-        self.assertEqual(j1, self.list.lookup(1))
-        self.assertRaises(KeyError, self.list.lookup, 2)
+        self.assertEqual(j1, self.list.lookup(j1.id))
+        self.assertRaises(KeyError, self.list.lookup, j1.id+1)
 
 def test_suite():
     return unittest.makeSuite(JobListTests)