Commit 74657dd2 authored by Łukasz Nowak's avatar Łukasz Nowak

- set up python version as part of test assertion to have more

   flexibility but less error prone magic
 - move getDevelopEggName to class, to reuse shared information about
   test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41193 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 49f3a8be
...@@ -107,13 +107,6 @@ def readElfAsDict(f): ...@@ -107,13 +107,6 @@ def readElfAsDict(f):
runpath_list=sorted(runpath_list) runpath_list=sorted(runpath_list)
) )
def getPythonVersion():
return '%s.%s' % util.sys.version_info[0:2]
def getDevelopEggName(name, version):
return '%s-%s-py%s-%s.egg' % (name, version, getPythonVersion(),
util.get_platform())
def readLddInfoList(f): def readLddInfoList(f):
popen = subprocess.Popen(['ldd', f], stdout=subprocess.PIPE, popen = subprocess.Popen(['ldd', f], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
...@@ -145,6 +138,11 @@ def readLddInfoList(f): ...@@ -145,6 +138,11 @@ def readLddInfoList(f):
return link_list return link_list
class AssertSoftwareMixin(unittest.TestCase): class AssertSoftwareMixin(unittest.TestCase):
python_version = '2.6'
def getDevelopEggName(self, name, version):
return '%s-%s-py%s-%s.egg' % (name, version, self.python_version,
util.get_platform())
def assertEqual(self, first, second, msg=None): def assertEqual(self, first, second, msg=None):
try: try:
return unittest.TestCase.assertEqual(self, first, second, msg=msg) return unittest.TestCase.assertEqual(self, first, second, msg=msg)
...@@ -1583,8 +1581,8 @@ class AssertBzip2(AssertSoftwareMixin): ...@@ -1583,8 +1581,8 @@ class AssertBzip2(AssertSoftwareMixin):
class AssertPysvn(AssertSoftwareMixin): class AssertPysvn(AssertSoftwareMixin):
def test_ld_pysvn(self): def test_ld_pysvn(self):
self.assertLibraryList('develop-eggs/%s/pysvn/_pysvn_%s.so' % ( self.assertLibraryList('develop-eggs/%s/pysvn/_pysvn_%s.so' % (
getDevelopEggName('pysvn', '1.7.4nxd006'), self.getDevelopEggName('pysvn', '1.7.4nxd006', self.python_version),
getPythonVersion().replace('.', '_')), [ self.python_verion.replace('.', '_')), [
'libc', 'libc',
'libgcc_s', 'libgcc_s',
'libm', 'libm',
...@@ -1599,7 +1597,7 @@ class AssertPysvn(AssertSoftwareMixin): ...@@ -1599,7 +1597,7 @@ class AssertPysvn(AssertSoftwareMixin):
class AssertLxml(AssertSoftwareMixin): class AssertLxml(AssertSoftwareMixin):
def test_ld_etree_so(self): def test_ld_etree_so(self):
egg_name = getDevelopEggName('lxml', '2.2.8') egg_name = self.getDevelopEggName('lxml', '2.2.8')
python_version_major, python_version_minor = util.sys.version_info[0:2] python_version_major, python_version_minor = util.sys.version_info[0:2]
self.assertLibraryList('develop-eggs/%s/lxml/etree.so' % (egg_name), [ self.assertLibraryList('develop-eggs/%s/lxml/etree.so' % (egg_name), [
'libc', 'libc',
...@@ -1616,7 +1614,7 @@ class AssertLxml(AssertSoftwareMixin): ...@@ -1616,7 +1614,7 @@ class AssertLxml(AssertSoftwareMixin):
]) ])
def test_ld_objectify_so(self): def test_ld_objectify_so(self):
egg_name = getDevelopEggName('lxml', '2.2.8') egg_name = self.getDevelopEggName('lxml', '2.2.8')
python_version_major, python_version_minor = util.sys.version_info[0:2] python_version_major, python_version_minor = util.sys.version_info[0:2]
self.assertLibraryList('develop-eggs/%s/lxml/objectify.so' % (egg_name), [ self.assertLibraryList('develop-eggs/%s/lxml/objectify.so' % (egg_name), [
'libc', 'libc',
......
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