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

Jeremy Hylton jeremy@zope.com
Tue, 19 Mar 2002 16:26:28 -0500


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

Added Files:
	__init__.py testJobList.py 
Log Message:
Add JobList container.


=== Added File Packages/JobBoardEx/tests/__init__.py ===
# test package


=== Added File Packages/JobBoardEx/tests/testJobList.py ===
import unittest

from ZopeProducts.JobBoardEx.JobList import JobList

class Job:
    def __init__(self, state):
        self.state = state

class JobListTests(unittest.TestCase):

    def setUp(self):
        self.list = JobList()

    def testBasicQuery(self):
        j1 = Job("foo")
        self.list.add(j1)
        l = self.list.query("foo")
        self.assertEqual(l, [j1])
        self.list.remove(j1)
        l = self.list.query("foo")
        self.assertEqual(l, [])

def test_suite():
    return unittest.makeSuite(JobListTests)