source: main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_interfaces.py @ 5730

Last change on this file since 5730 was 5680, checked in by uli, 14 years ago

Add tests for application category vocabulary.

File size: 2.0 KB
Line 
1##
2## test_interfaces.py
3## Login : <uli@pu.smp.net>
4## Started on  Tue Jan 25 17:09:46 2011 Uli Fouquet
5## $Id$
6##
7## Copyright (C) 2011 Uli Fouquet
8## This program is free software; you can redistribute it and/or modify
9## it under the terms of the GNU General Public License as published by
10## the Free Software Foundation; either version 2 of the License, or
11## (at your option) any later version.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16## GNU General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with this program; if not, write to the Free Software
20## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21##
22"""
23Test components defined in interface module.
24"""
25import unittest
26from zope.interface.verify import verifyClass, verifyObject
27from waeup.sirp.applicants import interfaces
28from waeup.sirp.applicants.interfaces import (
29    APPLICATION_CATEGORIES, application_categories_vocab,
30    )
31
32class ApplicationCategoriesTestCase(unittest.TestCase):
33
34    def setUp(self):
35        self.vocab = application_categories_vocab
36        return
37   
38    def test_vocabulary_len(self):
39        self.assertEqual(len(self.vocab), 5)
40        return
41
42    def test_vocabulary_items(self):
43        self.assertTrue('pde' in self.vocab)
44        return
45
46    def test_term_attributes(self):
47        # Check that each vocab entry provided value, token, and title.
48        term = self.vocab.getTermByToken('pde')
49        self.assertEqual(term.token, 'pde')
50        self.assertEqual(term.value, 'pde')
51        self.assertEqual(term.title, 'Direct Entry Screening Exam (PDE)')
52        return
53
54def suite():
55    suite = unittest.TestSuite()
56    for testcase in [
57            ApplicationCategoriesTestCase,
58            ]:
59        suite.addTests(unittest.TestLoader().loadTestsFromTestCase(testcase))
60    return suite
61
62test_suite = suite
63
64
Note: See TracBrowser for help on using the repository browser.