Last change
on this file since 6861 was
6568,
checked in by uli, 13 years ago
|
Add some unittests for course containers.
|
File size:
777 bytes
|
Line | |
---|
1 | # Test course containers |
---|
2 | |
---|
3 | import unittest |
---|
4 | from zope.interface.verify import verifyClass, verifyObject |
---|
5 | from waeup.sirp.university.interfaces import ICourseContainer |
---|
6 | from waeup.sirp.university import CourseContainer, Course |
---|
7 | |
---|
8 | class CourseContainerTests(unittest.TestCase): |
---|
9 | |
---|
10 | def test_ifaces(self): |
---|
11 | container = CourseContainer() |
---|
12 | self.assertTrue(verifyClass(ICourseContainer, CourseContainer)) |
---|
13 | self.assertTrue(verifyObject(ICourseContainer, container)) |
---|
14 | |
---|
15 | def test_setitem_name_ne_code(self): |
---|
16 | # If we add a course under a wrong name that will give an error |
---|
17 | container = CourseContainer() |
---|
18 | course = Course(code='MYCOURSE') |
---|
19 | self.assertRaises( |
---|
20 | ValueError, |
---|
21 | container.__setitem__, 'NOTMYCOURSE', course) |
---|
Note: See
TracBrowser for help on using the repository browser.