Ignore:
Timestamp:
12 Dec 2011, 07:01:54 (13 years ago)
Author:
Henrik Bettermann
Message:

Rename certificatecontainer, coursecontainer and facultycontainer. Now we have e.g. a container for faculties. Synonyms are 'facultiescontainer', 'faculties', 'academics' or 'Academic Section'. The faculty container is the faculty itself which contains the departments.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/university/tests
Files:
1 edited
3 moved

Legend:

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

    r7331 r7333  
    3030    FunctionalLayer, doctestsuite_for_module, FunctionalTestCase)
    3131from waeup.sirp.university.certificate import Certificate
    32 from waeup.sirp.university.certificatecontainer import CertificateContainer
    33 from waeup.sirp.university.interfaces import ICertificateContainer
     32from waeup.sirp.university.certificatescontainer import CertificatesContainer
     33from waeup.sirp.university.interfaces import ICertificatesContainer
    3434
    3535
    36 class CertificateContainerTests(FunctionalTestCase):
     36class CertificatesContainerTests(FunctionalTestCase):
    3737
    3838    layer = FunctionalLayer
    3939
    4040    def setUp(self):
    41         super(CertificateContainerTests, self).setUp()
     41        super(CertificatesContainerTests, self).setUp()
    4242
    4343        # Setup a sample site for each test
     
    5252
    5353    def tearDown(self):
    54         super(CertificateContainerTests, self).tearDown()
     54        super(CertificatesContainerTests, self).tearDown()
    5555        clearSite()
    5656        shutil.rmtree(self.dc_root)
     
    5858    def test_create(self):
    5959        # we can create instances
    60         container = CertificateContainer()
    61         result = isinstance(container, CertificateContainer)
     60        container = CertificatesContainer()
     61        result = isinstance(container, CertificatesContainer)
    6262        assert result is True
    6363
    64     def test_provides_icertificatecontainer(self):
     64    def test_provides_icertificatescontainer(self):
    6565        # instances tell they provide their main interface
    66         container = CertificateContainer()
    67         result = ICertificateContainer.providedBy(container)
     66        container = CertificatesContainer()
     67        result = ICertificatesContainer.providedBy(container)
    6868        assert result is True
    6969
    7070    def test_interfaces(self):
    7171        # class and instances comply with their main interface
    72         container = CertificateContainer()
    73         self.assertTrue(verifyClass(ICertificateContainer, CertificateContainer))
    74         self.assertTrue(verifyObject(ICertificateContainer, container))
     72        container = CertificatesContainer()
     73        self.assertTrue(verifyClass(ICertificatesContainer, CertificatesContainer))
     74        self.assertTrue(verifyObject(ICertificatesContainer, container))
    7575
    7676    def test_add_certificate_non_icertificate(self):
    7777        # we cannot add certificates that do not implement ICertificate.
    78         container = CertificateContainer()
     78        container = CertificatesContainer()
    7979        self.assertRaises(
    8080            TypeError, container.addCertificate, 'some_string')
     
    8282    def test_add_certificate_no_duplicate_entry(self):
    8383        # we cannot add certificates that are registered already.
    84         container = CertificateContainer()
     84        container = CertificatesContainer()
    8585        # We must place this container in the ZODB to make catalogs work.
    8686        self.app['certs'] = container
     
    9494    def test_setitem_duplicate_entry(self):
    9595        # we cannot add certificates whose code exists already in catalog
    96         container1 = CertificateContainer()
    97         container2 = CertificateContainer()
     96        container1 = CertificatesContainer()
     97        container2 = CertificatesContainer()
    9898        self.app['certs1'] = container1 # enable catalogs
    9999        self.app['certs2'] = container2
     
    108108    def test_setitem_name_unequal_code(self):
    109109        # we cannot add certificates whose code != key
    110         container = CertificateContainer()
     110        container = CertificatesContainer()
    111111        self.app['certs'] = container # enable catalogs
    112112        cert1 = Certificate(code="CERT1")
     
    118118    def test_clear(self):
    119119        # clear() really empties the container.
    120         container = CertificateContainer()
     120        container = CertificatesContainer()
    121121        self.app['certs'] = container # enable catalogs
    122122        cert1 = Certificate(code="CERT1")
     
    130130def test_suite():
    131131    suite = unittest.TestSuite((
    132         unittest.makeSuite(CertificateContainerTests),
     132        unittest.makeSuite(CertificatesContainerTests),
    133133        doctestsuite_for_module(
    134                 'waeup.sirp.university.certificatecontainer'),
     134                'waeup.sirp.university.certificatescontainer'),
    135135        ))
    136136    return suite
  • main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_coursescontainer.py

    r7331 r7333  
    2121import unittest
    2222from zope.interface.verify import verifyClass, verifyObject
    23 from waeup.sirp.university.interfaces import ICourseContainer
    24 from waeup.sirp.university import CourseContainer, Course
     23from waeup.sirp.university.interfaces import ICoursesContainer
     24from waeup.sirp.university import CoursesContainer, Course
    2525
    26 class CourseContainerTests(unittest.TestCase):
     26class CoursesContainerTests(unittest.TestCase):
    2727
    2828    def test_ifaces(self):
    29         container = CourseContainer()
    30         self.assertTrue(verifyClass(ICourseContainer, CourseContainer))
    31         self.assertTrue(verifyObject(ICourseContainer, container))
     29        container = CoursesContainer()
     30        self.assertTrue(verifyClass(ICoursesContainer, CoursesContainer))
     31        self.assertTrue(verifyObject(ICoursesContainer, container))
    3232
    3333    def test_setitem_name_ne_code(self):
    3434        # If we add a course under a wrong name that will give an error
    35         container = CourseContainer()
     35        container = CoursesContainer()
    3636        course = Course(code='MYCOURSE')
    3737        self.assertRaises(
  • main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_facultiescontainer.py

    r7331 r7333  
    1717##
    1818
    19 # Tests for FacultyContainer.
     19# Tests for FacultiesContainer.
    2020import logging
    2121import unittest
     
    2323from zope.interface.verify import verifyObject, verifyClass
    2424from waeup.sirp.testing import FunctionalTestCase, FunctionalLayer
    25 from waeup.sirp.university.interfaces import IFacultyContainer
    26 from waeup.sirp.university import FacultyContainer
    27 from waeup.sirp.university.facultycontainer import AcademicsPlugin
     25from waeup.sirp.university.interfaces import IFacultiesContainer
     26from waeup.sirp.university import FacultiesContainer
     27from waeup.sirp.university.facultiescontainer import AcademicsPlugin
    2828
    2929class FakeLogger(object):
     
    5454        return result
    5555
    56 class FacultyContainerTests(unittest.TestCase):
     56class FacultiesContainerTests(unittest.TestCase):
    5757
    5858    def test_ifaces(self):
    59         container = FacultyContainer()
    60         self.assertTrue(verifyClass(IFacultyContainer, FacultyContainer))
    61         self.assertTrue(verifyObject(IFacultyContainer, container))
     59        container = FacultiesContainer()
     60        self.assertTrue(verifyClass(IFacultiesContainer, FacultiesContainer))
     61        self.assertTrue(verifyObject(IFacultiesContainer, container))
    6262
    6363class AcademicsPluginTests(unittest.TestCase):
     
    7676        plugin.setup(site, 'testsite', logger)
    7777        self.assertTrue('faculties' in site.keys())
    78         self.assertTrue(isinstance(site['faculties'], FacultyContainer))
     78        self.assertTrue(isinstance(site['faculties'], FacultiesContainer))
    7979        self.assertEqual(
    8080            self._logger_factory.get_messages(),
    81             'Created faculty container for University\n'
     81            'Container for faculties created\n'
    8282            )
    8383
     
    9090        self.assertEqual(
    9191            self._logger_factory.get_messages(),
    92             'Could not create faculty container in SIRP.\n'
     92            'Could not create container for faculties in SIRP.\n'
    9393            )
    9494
     
    9999        plugin.update(site, 'testsite', logger)
    100100        self.assertTrue('faculties' in site.keys())
    101         self.assertTrue(isinstance(site['faculties'], FacultyContainer))
     101        self.assertTrue(isinstance(site['faculties'], FacultiesContainer))
    102102        self.assertEqual(
    103103            self._logger_factory.get_messages(),
    104             'Created faculty container for University\n'
     104            'Container for faculties created\n'
    105105            )
    106106
  • main/waeup.sirp/trunk/src/waeup/sirp/university/tests/test_university.py

    r7195 r7333  
    2727        names = globals().keys()
    2828        self.assertTrue('Course' in names)
    29         self.assertTrue('CourseContainer' in names)
     29        self.assertTrue('CoursesContainer' in names)
    3030        self.assertTrue('Faculty' in names)
    31         self.assertTrue('FacultyContainer' in names)
     31        self.assertTrue('FacultiesContainer' in names)
    3232
    3333def test_suite():
Note: See TracChangeset for help on using the changeset viewer.