Ignore:
Timestamp:
30 May 2011, 00:20:17 (14 years ago)
Author:
uli
Message:
  • Fix duplication tests.
  • Add working test for clear() method of CertificateContainer?. This one revealed that the old implementation was in fact faulty.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_certificatecontainer.py

    r6230 r6232  
    3232from zope.interface.verify import verifyClass, verifyObject
    3333from waeup.sirp.app import University
     34from waeup.sirp.interfaces import DuplicationError
    3435from waeup.sirp.testing import FunctionalLayer, WAeUPSIRPUnitTestLayer
    3536from waeup.sirp.university.certificate import Certificate
     
    9394        container.addCertificate(cert1)
    9495        self.assertRaises(
    95             ValueError,
     96            DuplicationError,
    9697            container.addCertificate, cert2)
    9798
     
    104105        self.app['certs']['SomeKey'] = cert1
    105106        self.assertRaises(
    106             ValueError,
     107            DuplicationError,
    107108            container.__setitem__, 'OtherKey', cert2)
    108109        assert len(container) == 1
     110
     111    def test_clear(self):
     112        container = CertificateContainer()
     113        self.app['certs'] = container # enable catalogs
     114        cert1 = Certificate(code="CERT1")
     115        cert2 = Certificate(code="CERT2")
     116        container['CERT1'] = cert1
     117        container['CERT2'] = cert2
     118        container.clear()
     119        assert len(container) == 0
    109120
    110121
Note: See TracChangeset for help on using the changeset viewer.