Changeset 5688 for main/waeup.sirp/trunk/src
- Timestamp:
- 26 Jan 2011, 12:19:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/tests/test_applicants.py
r5478 r5688 28 28 from zope.interface import verify 29 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable 30 from waeup.sirp. jambtables import (30 from waeup.sirp.applicants.jambtables import ( 31 31 ResultEntry, Applicant, ApplicantFactory, ApplicantContainer, 32 ApplicantsPlugin,33 32 ) 34 from waeup.sirp. jambtables.interfaces import (33 from waeup.sirp.applicants.jambtables.interfaces import ( 35 34 IResultEntry, IApplicant, IApplicantContainer, 36 35 ) … … 99 98 verify.verifyObject(IApplicantContainer, self.container) 100 99 101 class ApplicantsPluginTest(unittest.TestCase):102 103 def setUp(self):104 self.plugin = ApplicantsPlugin()105 self.site1 = dict()106 self.site2 = dict(applications = True)107 self.log_stream = StringIO()#.open('w')108 handler = logging.StreamHandler(self.log_stream)109 self.logger = logging.getLogger('waeup.sirp.testing')110 self.logger.addHandler(handler)111 self.logger.propagate = False112 self.logger.setLevel(logging.DEBUG)113 114 def tearDown(self):115 handlers = self.logger.handlers116 for handler in handlers:117 del handler118 pass119 120 def notest_interfaces(self):121 verify.verifyClass(IWAeUPSIRPPluggable, ApplicantsPlugin)122 verify.verifyObject(IWAeUPSIRPPluggable, self.plugin)123 124 def test_setup(self):125 self.plugin.setup(self.site1, 'some.site', self.logger)126 assert 'Installed application container' in self.log_stream.getvalue()127 assert 'applications' in self.site1.keys()128 129 def test_update_empty_site(self):130 self.plugin.update(self.site1, 'some.site', self.logger)131 assert 'Updating site' in self.log_stream.getvalue()132 assert 'Installing' in self.log_stream.getvalue()133 134 def test_update_filled_site(self):135 self.plugin.update(self.site2, 'some.site', self.logger)136 assert 'Nothing to do' in self.log_stream.getvalue()137 138 100 139 101 def test_suite(): … … 141 103 for testcase in [ 142 104 ResultEntryTest, ApplicantTest, ApplicantFactoryTest, 143 ApplicantContainerTest, ApplicantsPluginTest,105 ApplicantContainerTest, 144 106 ]: 145 107 suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
Note: See TracChangeset for help on using the changeset viewer.