Commit 002a3f62 authored by Łukasz Nowak's avatar Łukasz Nowak

- add docstrings


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34683 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a01255d9
...@@ -13,20 +13,14 @@ def createCleanList(s): ...@@ -13,20 +13,14 @@ def createCleanList(s):
return sorted([q.strip() for q in s.split() if len(q.strip()) > 0]) return sorted([q.strip() for q in s.split() if len(q.strip()) > 0])
class AssertPythonSoftware(unittest.TestCase): class AssertPythonSoftware(unittest.TestCase):
""" """Asserts that python related software is in good shape."""
TODO: Add doc string.
"""
def test_python_version(self): def test_python_version(self):
""" """Check built python version"""
TODO: Add doc string. self.assertEqual((2,4), sys.version_info[:2])
"""
self.assertEqual((2,4), sys.version_info[:2])
def test_use_generated_python(self): def test_use_generated_python(self):
""" """Checks generated python as python"""
TODO: Add doc string.
"""
fd, name = tempfile.mkstemp() fd, name = tempfile.mkstemp()
try: try:
f = os.fdopen(fd, 'w') f = os.fdopen(fd, 'w')
...@@ -45,17 +39,13 @@ print sys.version_info[:2] ...@@ -45,17 +39,13 @@ print sys.version_info[:2]
os.unlink(name) os.unlink(name)
def test_use_generated_python_as_normal_interpreter(self): def test_use_generated_python_as_normal_interpreter(self):
""" """Checks behabiour of generated python as interpreter"""
TODO: Add doc string.
"""
stdout, stderr = subprocess.Popen(["bin/python2.4", "-V"], stdout, stderr = subprocess.Popen(["bin/python2.4", "-V"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
self.assertTrue('Python 2.4' in stderr) self.assertTrue('Python 2.4' in stderr)
def test_required_libraries(self): def test_required_libraries(self):
""" """Checks possiblity of importing libraries"""
TODO: Add doc string.
"""
required_library_list = createCleanList(""" required_library_list = createCleanList("""
ERP5Diff ERP5Diff
MySQLdb MySQLdb
...@@ -96,43 +86,31 @@ print sys.version_info[:2] ...@@ -96,43 +86,31 @@ print sys.version_info[:2]
'Python libraries not found:\n'+'\n'.join(failed_library_list)) 'Python libraries not found:\n'+'\n'.join(failed_library_list))
class AssertLddLibs(unittest.TestCase): class AssertLddLibs(unittest.TestCase):
""" """Checks for dynamic libraries"""
TODO: Add doc string.
"""
def test_tritonn_senna(self): def test_tritonn_senna(self):
""" """Senna as an library"""
TODO: Add doc string.
"""
result = os.system("ldd parts/mysql-tritonn-5.0/libexec/mysqld | grep -q " result = os.system("ldd parts/mysql-tritonn-5.0/libexec/mysqld | grep -q "
"'parts/senna/lib/libsenna.so.0'") "'parts/senna/lib/libsenna.so.0'")
self.assertEqual(result, 0) self.assertEqual(result, 0)
def test_MySQLdb(self): def test_MySQLdb(self):
""" """Checks proper linking to mysql library from MySQLdb egg"""
TODO: Add doc string.
"""
result = os.system("ldd develop-eggs/MySQL_python-1.2.3c1-py2.4-linux-x86" result = os.system("ldd develop-eggs/MySQL_python-1.2.3c1-py2.4-linux-x86"
"_64.egg/_mysql.so | grep -q 'parts/mysql-tritonn-5.0/lib/mysql/libmys" "_64.egg/_mysql.so | grep -q 'parts/mysql-tritonn-5.0/lib/mysql/libmys"
"qlclient_r.so'") "qlclient_r.so'")
self.assertEqual(result, 0) self.assertEqual(result, 0)
def test_memcached_libevent(self): def test_memcached_libevent(self):
""" """Checks proper liunking to libevent from memcached"""
TODO: Add doc string.
"""
result = os.system("ldd parts/memcached/bin/memcached | grep -q 'parts/li" result = os.system("ldd parts/memcached/bin/memcached | grep -q 'parts/li"
"bevent/lib/libevent'") "bevent/lib/libevent'")
class AssertApache(unittest.TestCase): class AssertApache(unittest.TestCase):
""" """Tests for built apache"""
TODO: Add doc string.
"""
def test_modules(self): def test_modules(self):
""" """Checks for availability of apache modules"""
TODO: Add doc string.
"""
required_module_list = createCleanList(""" required_module_list = createCleanList("""
authn_default_module authn_default_module
log_config_module log_config_module
...@@ -211,6 +189,5 @@ class AssertApache(unittest.TestCase): ...@@ -211,6 +189,5 @@ class AssertApache(unittest.TestCase):
self.assertEqual([], failed_module_list, self.assertEqual([], failed_module_list,
'Apache modules not found:\n'+'\n'.join(failed_module_list)) 'Apache modules not found:\n'+'\n'.join(failed_module_list))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment