[qmtest] An urgent question
Stefan Seefeld
stefan at codesourcery.com
Tue May 29 13:39:25 UTC 2007
Spector,
please use the QMTest mailing list for questions related to QMTest.
Spector Yaniv wrote:
> Hi Stefan,
>
> Follow it is a part of my code of a new class template I inserted in
> the QMTest for my testing :
I don't think writing your own test classes only to be able to store
start and end time in a different way is a sensible thing to do.
Rather, as I suggested, you should access (and modify) these times
in the generated results file. They are stored as annotations to each
result.
> I reviewed the API for ResultReader as you indicate me , it talks about
> Module qm.test.result_reader and class :
> "ResultReader" which provides access to stored test results.
>
> But is very dificcult to understand how I use it in my template class
> to access to qmtest result file and change the time to my local timezone
> (+3). ( Sorry but I am programmer begginer)
>
> Please could you send me un example (python) that help me to perfome me
> it by using the ResultReader class
Let's assume you have a results file (typically '.qmr') generated by 'qmtest run...'.
Here are some lines of python to open such a file, and iterate over individual
results:
rom qm.test import base
from qm.test.result import Result
input = base.load_results(open('results.qmr', 'rb'), None)
for r in input:
print '%s: start time: %s, end time: %s'\
%(r.GetId(), r.get('qmtest.start_time'), r.get('qmtest.end_time'))
Please find details concerning the ResultStream and Result API in
the (online) API Reference Manual.
Regards,
Stefan
--
Stefan Seefeld
CodeSourcery
stefan at codesourcery.com
(650) 331-3385 x718
More information about the qmtest
mailing list