Tester.py in POD renders no result

Asked by amartino on 2013-01-16

Hello there!

I'm trying to implement impotrting svg files with pod. SInce I want to make it as standardised as possible, a tried to follow the testing pattern already developed.

So i added an example .svg file to images:

pod/test/images/
├── graph.svg
├── linux.jpg
├── plone.png
└── python.gif

Then I added the following lines the ImagesImport.odt

A PNG image.
->A SVG image
The GIF image with an anchor to the paragraph.

With the comment:

from document(at='%s/pod/test/images/graph.svg' %

I then ran

python Tester.py ImagesImport.odt

Which reports: "59/62 successful test(s), but 3 ignored test(s) not counted."

However, the rendered result is nowhere to be found. I searchead the appy directory for result.odt (as found in Readme.txt) witouht success. And have also checked pod/test/results/imagesImport.odt but it was unchanged.

Where are the rendered tests located?

Question information

Language:
English Edit question
Status:
Answered
For:
Appy Edit question
Assignee:
No assignee Edit question
Last query:
2013-01-16
Last reply:
2013-01-22

Hi Alan (I suppose you are Alan? :)),
The tests are defined in a RTF file, appy/pod/test/Tests.rtf.

I let you open this file and understand its content. Tests are grouped into suites. For every suite, there are 2 tables: one that comments every test, one that defines the data about it. This file is "executable", update it with caution!
You can add a test into table "PodImports". Read the comment for this table: I have currently a little problem with such tests.

In column "Template", you must give the name (without the .odt suffix) of the pod template used for the test, that must exist in pod/test/templates. In column "Context", you must give the name (without the .py suffix) of the Python file that will represent the context that will be given to the pod renderer for the test.

The result of the test will be generated in pod/test/temp, but if you don't want this folder to be deleted after running Tester.py, run it like this:

<yourPython> Tester.py -k -v
("k" stands for "keep temp folder", "v" stands for "verbose").

By the way, if you run several tests at once (which is the case if you simply run Tester.py like shown above), only the result of the last executed test will lie in pod/test/temp.

In order to run your test only, you must edit the file Tests.rtf and:
1) prefix every test suite name (excepted yours, PodImports), from the 4th table, with an underscore (_). Insert no space at all;
2) prefix, within the second table of your test suite, every test (excepted yours) with an underscore.

Good tests :)

By the way, if you get the result:
"59/62 successful test(s), but 3 ignored test(s) not counted."

It probably means that you have broken 3 tests, AND that 3 more tests were not counted (indeed, currently I have disabled 3 tests because of the problem I mention in Tests.rtf, you will see them prefixed with an underscore). Or this could be that some tests are simply broken on your machine for some other reason. To check details about broken tests, consult file pod/test/Tester.report.txt that is generated every time you run Tester.py.

Sorry this was an answer!

dirk (dirk-janssen) said : #3

Just because this ends up high in google searches: Gaëtan's answer is correct but I would not recommend going down this route at all. You are trying to make the pod test framework do things that it wasn't meant for.

To test images, or run any other of these provided documents, it is much simpler to copy the pod/test/template/ImagesImport.odt file to your own directory. Copy the image files too. Then create (copy/paste) a 5 line python script to generate odt from this, as is explained on the main documentation page http://appyframework.org/pod.html. All you have to do is adjust the paths in the comments, just take out the getAppyPath() bit.

Can you help with this problem?

Provide an answer of your own, or ask amartino for more information if necessary.

To post a message you must log in.