Changeset 1604 for WAeUP_SRP/branches/uli/tests
- Timestamp:
- 20 Mar 2007, 04:02:42 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/branches/uli/tests/test_waeuptool.py
r1603 r1604 25 25 26 26 class TestWAeUP_Tool(WAeUP_SRPTest): 27 """Tests for WAeUP tool. 28 29 XXX Currently almost all tests check only, whether a certain 30 method exists in waeuptool. Real unit tests have to be 31 implemented. 32 """ 33 27 34 def test_waeuptool_install(self): 28 35 """Check, whether a waeup_tool is available in site root. … … 31 38 "WAeUP site got no waeup_tool") 32 39 wtool = self.portal.waeup_tool 40 return 33 41 34 42 def test_getLogfileLines(self): … … 51 59 result = wtool.getLogfileLines() 52 60 self.failUnlessEqual( len(result), 20) 61 return 62 63 def test_generateStudentId(self): 64 """Check waeup_tool method generateStudentId(). 65 """ 66 wtool = self.portal.waeup_tool 67 self.assertTrue( hasattr( wtool, "generateStudentId" ), 68 "waeup_tool got no method generateStudentId()") 69 result = wtool.generateStudentId( 'A' ) # Deliver a leading char... 70 self.assertTrue( len(result) == 7, 71 "Generated StudentId length != 7: %s"%result ) 72 self.assertTrue( result[0] == "A", 73 "Generated StudentId first char != 'A': %s"%result) 74 self.assertTrue( False not in [x in "0123456789" for x in result[1:]], 75 "Generated StudentId contains non digits: %s"%result) 76 77 result = wtool.generateStudentId( '?' ) # Deliver no leading char... 78 self.assertTrue( len(result) == 7, 79 "Generated StudentId length != 7: %s"%result ) 80 self.assertTrue( result[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 81 "Generated StudentId first char not alphabetical: %s"%result) 82 self.assertTrue( False not in [x in "0123456789" for x in result[1:]], 83 "Generated StudentId contains non digits: %s"%result) 84 85 try: 86 result = wtool.generateStudentId( '' ) # Deliver empty char... 87 except TypeError: 88 self.fail( "waeuptool.generateStudentId accepts only chars and '?' as argument." ) 89 self.assertTrue( len(result) == 7, 90 "Generated StudentId length != 7: %s"%result ) 91 self.assertTrue( result[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 92 "Generated StudentId first char not alphabetical: %s"%result) 93 self.assertTrue( False not in [x in "0123456789" for x in result[1:]], 94 "Generated StudentId contains non digits: %s"%result) 95 96 return 97 98 def test_generatePassword(self): 99 """Check waeup_tool method generatePassword(). 100 """ 101 wtool = self.portal.waeup_tool 102 self.assertTrue( hasattr( wtool, "generatePassword" ), 103 "waeup_tool got no method generatePassword()") 104 return 105 106 def test_getCredential(self): 107 """Check waeup_tool method getCredential(). 108 """ 109 wtool = self.portal.waeup_tool 110 self.assertTrue( hasattr( wtool, "getCredential" ), 111 "waeup_tool got no method getCredential()") 112 return 113 114 def test_checkPassword(self): 115 """Check waeup_tool method checkPassword() 116 """ 117 wtool = self.portal.waeup_tool 118 self.assertTrue( hasattr( wtool, "checkPassword" ), 119 "waeup_tool got no method checkPassword()") 120 return 121 122 def test_editPassword(self): 123 """Check waeup_tool method editPassword() 124 """ 125 wtool = self.portal.waeup_tool 126 self.assertTrue( hasattr( wtool, "editPassword" ), 127 "waeup_tool got no method editPassword()") 128 return 129 130 def test_doCommit(self): 131 """Check waeup_tool method doCommit() 132 """ 133 wtool = self.portal.waeup_tool 134 self.assertTrue( hasattr( wtool, "doCommit" ), 135 "waeup_tool got no method doCommit()") 136 return 137 138 def test_loadStudentFoto(self): 139 """Check waeup_tool method loadStudentFoto() 140 """ 141 wtool = self.portal.waeup_tool 142 self.assertTrue( hasattr( wtool, "loadStudentFoto" ), 143 "waeup_tool got no method loadStudentFoto()") 144 return 145 146 def test_loadStudentFoto(self): 147 """Check waeup_tool method loadStudentFoto() 148 """ 149 wtool = self.portal.waeup_tool 150 self.assertTrue( hasattr( wtool, "loadStudentFoto" ), 151 "waeup_tool got no method loadStudentFoto()") 152 return 153 154 def test_createOne(self): 155 """Check waeup_tool method createOne() 156 """ 157 wtool = self.portal.waeup_tool 158 self.assertTrue( hasattr( wtool, "createOne" ), 159 "waeup_tool got no method createOne()") 160 return 161 162 def test_createStudent(self): 163 """Check waeup_tool method createStudent() 164 """ 165 wtool = self.portal.waeup_tool 166 self.assertTrue( hasattr( wtool, "createStudent" ), 167 "waeup_tool got no method createStudent()") 168 return 169 170 def test_getCertificateBrain(self): 171 """Check waeup_tool method getCertificateBrain() 172 """ 173 wtool = self.portal.waeup_tool 174 self.assertTrue( hasattr( wtool, "getCertificateBrain" ), 175 "waeup_tool got no method getCertificateBrain()") 176 return 177 178 def test_findStudentByMatricelNo(self): 179 """Check waeup_tool method findStudentByMatricelNo() 180 """ 181 wtool = self.portal.waeup_tool 182 self.assertTrue( hasattr( wtool, "findStudentByMatricelNo" ), 183 "waeup_tool got no method findStudentByMatricelNo()") 184 return 185 186 def test_makeStudentMember(self): 187 """Check waeup_tool method makeStudentMember() 188 """ 189 wtool = self.portal.waeup_tool 190 self.assertTrue( hasattr( wtool, "makeStudentMember" ), 191 "waeup_tool got no method makeStudentMember()") 192 return 193 194 def test_makeStudentData(self): 195 """Check waeup_tool method makeStudentData() 196 """ 197 wtool = self.portal.waeup_tool 198 self.assertTrue( hasattr( wtool, "makeStudentData" ), 199 "waeup_tool got no method makeStudentData()") 200 return 201 202 def test_makeStudentLevel(self): 203 """Check waeup_tool method makeStudentLevel() 204 """ 205 wtool = self.portal.waeup_tool 206 self.assertTrue( hasattr( wtool, "makeStudentLevel" ), 207 "waeup_tool got no method makeStudentLevel()") 208 return 209 210 def test_getAccommodationInfo(self): 211 """Check waeup_tool method getAccommodationInfo() 212 """ 213 wtool = self.portal.waeup_tool 214 self.assertTrue( hasattr( wtool, "getAccommodationInfo" ), 215 "waeup_tool got no method getAccommodationInfo()") 216 return 217 218 def test_deleteAllCourses(self): 219 """Check waeup_tool method deleteAllCourses() 220 """ 221 wtool = self.portal.waeup_tool 222 self.assertTrue( hasattr( wtool, "deleteAllCourses" ), 223 "waeup_tool got no method deleteAllCourses()") 224 return 53 225 54 226
Note: See TracChangeset for help on using the changeset viewer.