Hi,
it seems that apitest does not work with recent python (>2.2) where ElementTree
is part of xml.etree.
Replacing all occurence of "from elementtree import ElementTree" with "from
xml.etree.ElementTree import ElementTree" is not sufficient.
apitest was developped with ElementTree v1.2.6 while current python
implementations are using v1.3.0 final which has some differences:
http://effbot.org/zone/elementtree-13-intro.htm
doing so will result in the following error:
$ apitest -v -T -f /usr/share/doc/apitest/examples/script/script_foo.apt
Unhandled Error
Traceback (most recent call last):
File "/usr/bin/apitest", line 162, in start
self.start_cmdLine()
File "/usr/bin/apitest", line 297, in start_cmdLine
reactor.run()
File "/usr/lib64/python2.7/site-packages/twisted/internet/base.py", line
1169, in run
self.mainLoop()
File "/usr/lib64/python2.7/site-packages/twisted/internet/base.py", line
1178, in mainLoop
self.runUntilCurrent()
--- <exception caught here> ---
File "/usr/lib64/python2.7/site-packages/twisted/internet/base.py", line 800,
in runUntilCurrent
call.func(*call.args, **call.kw)
File "/usr/lib64/python2.7/site-packages/libapitest/jobManager.py", line 114,
in poll
self.do_task()
File "/usr/lib64/python2.7/site-packages/libapitest/jobManager.py", line 126,
in do_task
self.Execute()
File "/usr/lib64/python2.7/site-packages/libapitest/jobManager.py", line 244,
in Execute
tH.prepare(task)
File "/usr/lib64/python2.7/site-packages/libapitest/libapitest.py", line 302,
in prepare
self.load(testFileName)
File "/usr/lib64/python2.7/site-packages/libapitest/libapitest.py", line 384,
in load
self.xmlFileTree = ElementTree.parse(self.testFileName)
exceptions.TypeError: unbound method parse() must be called with ElementTree
instance as first argument (got str instance instead)
and when trying to mimic opkgc by replacing "from elementtree" import
ElementTree by from lxml import etree (and replace ElementTree with etree in
aull apitest py files, it crashes like that:
# apitest -v -T -f script_foo.apt
/usr/lib64/python2.6/site-packages/libapitest/libapitest.py:35:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
Traceback (most recent call last):
File "/usr/bin/apitest", line 162, in start
self.start_cmdLine()
File "/usr/bin/apitest", line 297, in start_cmdLine
reactor.run()
File "/usr/lib64/python2.6/site-packages/twisted/internet/base.py", line
1128, in run
self.mainLoop()
File "/usr/lib64/python2.6/site-packages/twisted/internet/base.py", line
1137, in mainLoop
self.runUntilCurrent()
--- <exception caught here> ---
File "/usr/lib64/python2.6/site-packages/twisted/internet/base.py", line 757,
in runUntilCurrent
call.func(*call.args, **call.kw)
File "/usr/lib64/python2.6/site-packages/libapitest/jobManager.py", line 114,
in poll
self.do_task()
File "/usr/lib64/python2.6/site-packages/libapitest/jobManager.py", line 126,
in do_task
self.Execute()
File "/usr/lib64/python2.6/site-packages/libapitest/jobManager.py", line 246,
in Execute
tH.execute()
File "/usr/lib64/python2.6/site-packages/libapitest/libapitest.py", line 551,
in execute
execFunc()
File "/usr/lib64/python2.6/site-packages/libapitest/testHandler.py", line
323, in do_script
out_file.write(theScriptBody)
exceptions.TypeError: argument 1 must be string or read-only character buffer,
not None
theScriptBody is "None" (xmlcommand.text is None)
thanks a lot for help.
Best Regards,
Olivier.
--
Olivier LAHAYE
CEA DRT/LIST/DM2I/DIR
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel