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

Fred L. Drake, Jr. fdrake@acm.org
Tue, 19 Mar 2002 17:47:13 -0500


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

Added Files:
	testJob.py 
Log Message:
Basic Job object.

=== Added File Packages/JobBoardEx/tests/testJob.py ===
"""
testJob.py
"""

import unittest

from ZopeProducts.JobBoardEx.Job import Job
from ZopeProducts.JobBoardEx.IJob import JobState

class JobTestCase(unittest.TestCase):

    def setUp(self):
        self.job = Job("submitter", "summary", "description",
                       "contactURL", "contactEmail")

    def test_initialization(self):
        self.assertEqual(self.job.getSubmitter(), 'submitter')
        self.assertEqual(self.job.getSummary(), 'summary')
        self.assertEqual(self.job.getDescription(), 'description')
        self.assertEqual(self.job.getContactURL(), 'contactURL')
        self.assertEqual(self.job.getContactEmail(), 'contactEmail')
        self.assertEqual(self.job.getState(), JobState.PendingApproval)

    def test_states(self):
        self.job.approve()
        self.assertEqual(self.job.getState(), JobState.Approved)

def test_suite():
    return unittest.TestSuite((unittest.makeSuite(JobTestCase),))

if __name__ == "__main__":
    unittest.main(defaultTest='test_suite')