Index: WAeUP_SRP/branches/uli/tests/test_waeuptool.py
===================================================================
--- WAeUP_SRP/branches/uli/tests/test_waeuptool.py	(revision 1603)
+++ WAeUP_SRP/branches/uli/tests/test_waeuptool.py	(revision 1604)
@@ -25,4 +25,11 @@
 
 class TestWAeUP_Tool(WAeUP_SRPTest):
+    """Tests for WAeUP tool.
+
+    XXX Currently almost all tests check only, whether a certain
+    method exists in waeuptool. Real unit tests have to be
+    implemented.
+    """
+    
     def test_waeuptool_install(self):
         """Check, whether a waeup_tool is available in site root.
@@ -31,4 +38,5 @@
                          "WAeUP site got no waeup_tool")
         wtool = self.portal.waeup_tool
+        return
 
     def test_getLogfileLines(self):
@@ -51,4 +59,168 @@
         result = wtool.getLogfileLines()
         self.failUnlessEqual( len(result), 20)
+        return
+
+    def test_generateStudentId(self):
+        """Check waeup_tool method generateStudentId().
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "generateStudentId" ),
+                         "waeup_tool got no method generateStudentId()")
+        result = wtool.generateStudentId( 'A' ) # Deliver a leading char...
+        self.assertTrue( len(result) == 7,
+                         "Generated StudentId length != 7: %s"%result )
+        self.assertTrue( result[0] == "A",
+                         "Generated StudentId first char != 'A': %s"%result)
+        self.assertTrue( False not in [x in "0123456789" for x in result[1:]],
+                         "Generated StudentId contains non digits: %s"%result)
+
+        result = wtool.generateStudentId( '?' ) # Deliver no leading char...
+        self.assertTrue( len(result) == 7,
+                         "Generated StudentId length != 7: %s"%result )
+        self.assertTrue( result[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+                         "Generated StudentId first char not alphabetical: %s"%result)
+        self.assertTrue( False not in [x in "0123456789" for x in result[1:]],
+                         "Generated StudentId contains non digits: %s"%result)
+
+        try:
+            result = wtool.generateStudentId( '' ) # Deliver empty char...
+        except TypeError:
+            self.fail( "waeuptool.generateStudentId accepts only chars and '?' as argument." )
+        self.assertTrue( len(result) == 7,
+                         "Generated StudentId length != 7: %s"%result )
+        self.assertTrue( result[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+                         "Generated StudentId first char not alphabetical: %s"%result)
+        self.assertTrue( False not in [x in "0123456789" for x in result[1:]],
+                         "Generated StudentId contains non digits: %s"%result)
+
+        return
+
+    def test_generatePassword(self):
+        """Check waeup_tool method generatePassword().
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "generatePassword" ),
+                         "waeup_tool got no method generatePassword()")
+        return
+
+    def test_getCredential(self):
+        """Check waeup_tool method getCredential().
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "getCredential" ),
+                         "waeup_tool got no method getCredential()")
+        return
+
+    def test_checkPassword(self):
+        """Check waeup_tool method checkPassword()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "checkPassword" ),
+                         "waeup_tool got no method checkPassword()")
+        return
+
+    def test_editPassword(self):
+        """Check waeup_tool method editPassword()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "editPassword" ),
+                         "waeup_tool got no method editPassword()")
+        return
+
+    def test_doCommit(self):
+        """Check waeup_tool method doCommit()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "doCommit" ),
+                         "waeup_tool got no method doCommit()")
+        return
+
+    def test_loadStudentFoto(self):
+        """Check waeup_tool method loadStudentFoto()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "loadStudentFoto" ),
+                         "waeup_tool got no method loadStudentFoto()")
+        return
+
+    def test_loadStudentFoto(self):
+        """Check waeup_tool method loadStudentFoto()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "loadStudentFoto" ),
+                         "waeup_tool got no method loadStudentFoto()")
+        return
+
+    def test_createOne(self):
+        """Check waeup_tool method createOne()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "createOne" ),
+                         "waeup_tool got no method createOne()")
+        return
+
+    def test_createStudent(self):
+        """Check waeup_tool method createStudent()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "createStudent" ),
+                         "waeup_tool got no method createStudent()")
+        return
+
+    def test_getCertificateBrain(self):
+        """Check waeup_tool method getCertificateBrain()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "getCertificateBrain" ),
+                         "waeup_tool got no method getCertificateBrain()")
+        return
+
+    def test_findStudentByMatricelNo(self):
+        """Check waeup_tool method findStudentByMatricelNo()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "findStudentByMatricelNo" ),
+                         "waeup_tool got no method findStudentByMatricelNo()")
+        return
+
+    def test_makeStudentMember(self):
+        """Check waeup_tool method makeStudentMember()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "makeStudentMember" ),
+                         "waeup_tool got no method makeStudentMember()")
+        return
+
+    def test_makeStudentData(self):
+        """Check waeup_tool method makeStudentData()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "makeStudentData" ),
+                         "waeup_tool got no method makeStudentData()")
+        return
+
+    def test_makeStudentLevel(self):
+        """Check waeup_tool method makeStudentLevel()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "makeStudentLevel" ),
+                         "waeup_tool got no method makeStudentLevel()")
+        return
+
+    def test_getAccommodationInfo(self):
+        """Check waeup_tool method getAccommodationInfo()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "getAccommodationInfo" ),
+                         "waeup_tool got no method getAccommodationInfo()")
+        return
+
+    def test_deleteAllCourses(self):
+        """Check waeup_tool method deleteAllCourses()
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "deleteAllCourses" ),
+                         "waeup_tool got no method deleteAllCourses()")
+        return
 
 
