source: main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_coursecontainer.py @ 6740

Last change on this file since 6740 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
3import unittest
4from zope.interface.verify import verifyClass, verifyObject
5from waeup.sirp.university.interfaces import ICourseContainer
6from waeup.sirp.university import CourseContainer, Course
7
8class 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.