Changeset 9777 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 6 Dec 2012, 11:23:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r9325 r9777 17 17 ## 18 18 import unittest 19 from waeup.kofa.students.vocabularies import StudyLevelSource 19 from waeup.kofa.students.vocabularies import ( 20 StudyLevelSource, levels_from_range, 21 ) 20 22 from waeup.kofa.university.certificate import Certificate 21 23 24 class HelperTests(unittest.TestCase): 25 26 def test_levels_from_range(self): 27 # default 28 self.assertEqual( 29 levels_from_range(), 30 [10, 31 100, 110, 120, 200, 210, 220, 300, 310, 320, 400, 410, 420, 32 500, 510, 520, 600, 610, 620, 700, 710, 720, 800, 810, 820, 33 900, 910, 920, 999,]) 34 # edge-case: level 10 35 self.assertEqual( 36 levels_from_range(10, 10), [10]) 37 # edge-case: level 999 38 self.assertEqual( 39 levels_from_range(999, 10), [999]) 40 self.assertEqual( 41 levels_from_range(10, 999), [999]) 42 self.assertEqual( 43 levels_from_range(10, 200), 44 [10, 100, 110, 120, 200, 210, 220, 300, 310, 320]) 45 self.assertEqual( 46 levels_from_range(100, 300), 47 [100, 110, 120, 200, 210, 220, 300, 310, 320, 400, 410, 420]) 48 self.assertEqual( 49 levels_from_range(800, 900), 50 [800, 810, 820, 900, 910, 920]) 51 return 22 52 23 53 class FakeStudyCourse(object):
Note: See TracChangeset for help on using the changeset viewer.