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 1603)
@@ -0,0 +1,60 @@
+##
+## test_waeuptool.py
+## Login : <uli@gnufix.de>
+## Started on  Sun Mar 18 05:36:19 2007 Uli Fouquet
+## $Id$
+## 
+## Copyright (C) 2007 Uli Fouquet
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+import unittest
+
+from waeuptest import WAeUP_SRPTest
+
+class TestWAeUP_Tool(WAeUP_SRPTest):
+    def test_waeuptool_install(self):
+        """Check, whether a waeup_tool is available in site root.
+        """
+        self.assertTrue( hasattr(self.portal,  "waeup_tool" ),
+                         "WAeUP site got no waeup_tool")
+        wtool = self.portal.waeup_tool
+
+    def test_getLogfileLines(self):
+        """Check waeup_tool method getLogfileLines().
+        """
+        wtool = self.portal.waeup_tool
+        self.assertTrue( hasattr( wtool, "getLogfileLines" ),
+                         "waeup_tool got no method getLogfileLines")
+        result = wtool.getLogfileLines( "event.log", 23 )
+        self.failIfEqual( result, "" )
+        self.failUnlessEqual( len(result), 23)
+        result = wtool.getLogfileLines( "Z2.log", 23 )
+        self.failUnlessEqual( len(result), 23)
+        result = wtool.getLogfileLines( "Z2.log", -1 )
+        self.failUnlessEqual( len(result), 0)
+        result = wtool.getLogfileLines( "Z2.log" )
+        self.failUnlessEqual( len(result), 20)
+        result = wtool.getLogfileLines( "NotExistingFile" )
+        self.failUnlessEqual( len(result), 0)
+        result = wtool.getLogfileLines()
+        self.failUnlessEqual( len(result), 20)
+
+
+    
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(TestWAeUP_Tool),
+        ))
+
