Changeset 6241 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 30 May 2011, 01:49:09 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_certificatecontainer.py
r6239 r6241 98 98 def test_setitem_duplicate_entry(self): 99 99 # we cannot add certificates whose code exists already in catalog 100 container1 = CertificateContainer() 101 container2 = CertificateContainer() 102 self.app['certs1'] = container1 # enable catalogs 103 self.app['certs2'] = container2 104 cert1 = Certificate(code="CERT1") 105 cert2 = Certificate(code="CERT1") 106 self.app['certs1']['CERT1'] = cert1 107 self.assertRaises( 108 DuplicationError, 109 self.app['certs2'].__setitem__, 'CERT1', cert2) 110 assert len(container2) == 0 111 112 def test_setitem_name_unequal_code(self): 113 # we cannot add certificates whose code != key 100 114 container = CertificateContainer() 101 115 self.app['certs'] = container # enable catalogs 102 116 cert1 = Certificate(code="CERT1") 103 cert2 = Certificate(code="CERT1")104 self.app['certs']['SomeKey'] = cert1105 117 self.assertRaises( 106 DuplicationError,107 container.__setitem__, 'OtherKey', cert 2)108 assert len(container) == 1118 ValueError, 119 container.__setitem__, 'OtherKey', cert1) 120 assert len(container) == 0 109 121 110 122 def test_clear(self): 123 # clear() really empties the container. 111 124 container = CertificateContainer() 112 125 self.app['certs'] = container # enable catalogs
Note: See TracChangeset for help on using the changeset viewer.