Pod test plan
This document describes the integration test plan for POD. Be careful: this test plan is executable! So do not modify the tables without having knowledge of Tester.py, the program that uses this document for executing tests.
Configuration
Configuration	
key	value	
ooPort	2002	
pythonWithUnoPath	/usr/bin/python	

Abstract tables
The table below represents any test.

AnyTest	
Name	Template	Context	OpenOfficePort:i	StylesMapping	Result	
anyTest	NoPython	Nominal	2002		odt	

The table below represents a test that produces an error.

ErrorTest(AnyTest)	
Name	Message	
podError		

Test suites
The table below contains all the test suites of the plan. Prepending a ‘_’ character to the test suite name or to any test name within the TestSuiteX.data tables of this document prevents the test program from reading it.

TestSuites	
Name	Description	
PodNominal	Tests all functions of pod with tests that do not produce errors.	
PodErrorsInTemplate	Tests errors that are generated as notes within templates.	
PodErrors	Tests errors that are produced as exceptions by pod.	
PodXhtml	Tests for rendering XHTML chunks in an ODT document.	
PodImports	Tests the import of documents into a pod template.	
PodNominal
PodNominal.descriptions	
Name	Description	
noPython	A template containing complex content (tables, inner tables, sections, etc) but containing no POD expressions is dumped. The result must be the same as the template.	
withAnImage	Idem, but also with a image embedded into the document.	
onlyExpressions	A template containing simple pod expressions is dumped.	
simpleIfIsTrue	A template containing a simple if statement is dumped (the statement in the context resolves to True).	
simpleIfIsTrue003	Same as simpleIfIsTrue, but with a template made with OpenOffice 3 that adds formatting within notes.	
simpleIfIsFalse	A template containing a simple if statement is dumped (the statement in the context resolves to False).	
simpleForEmptyList	A template containing a simple for statement is dumped (the statement in the context resolves to an empty list).	
simpleForFilledList	A template containing a simple for statement is dumped (the statement in the context resolves to a list with some elements).	
simpleForRow	A table row is repeated.	
ifAndFors1	A mix of “if” and “for” statements are used with tables and sections.	
forCellCorrectNumber	A cell is repeated. The number of resulting cells is correct to produce a coherent table.	
forCellNotEnough	A cell is repeated. The number of resulting cells of the last row is not sufficient to produce a coherent table, so pod adds cells.	
forCellTooMuch1	A cell is repeated. The number of resulting cells of the last row is too high. So pod splits it.	
forCellTooMuch2	Idem, but with a different number of (surplus) cells.	
forCellTooMuch3	Idem, but with a different number of (surplus) cells.	
forCellTooMuch4	Idem, but with a different number of (surplus) cells.	
forCellOnlyOne	Yet another cell repetition.	
forCellBug	Yet another cell repetition.	
forCellBug2	Yet another cell repetition. There was a bug: pod did not remember the column index of the cell (within its table) where the 'for' statement was defined.	
forTable	A whole one-cell table is repeated.	
forTableMinus	A whole one-cell table is repeated, but is then removed from the result through with the “minus” operator.	
forTableMinus2	Idem above, but an inner table is in the cell. The inner table is not “minused”.	
simpleTest	A simple test used as introductory example on the website.	
headerFooter	Tests that pod replacements works in headers and footers.	
simpleFromTest	Simple test that includes the “from” part of a statement. Includes all error cases as well.	
elseStatements	Tests the “else” statements (including some errors in template).	
varDef	Defines variables in 'do … with' statements.	
chart1	Renders a simple chart.	
fieldExpression	Tests a new way to insert POD expressions, via a field. A field can be cut-and-pasted; this is not as easy with track-changed text.	

PodNominal.data(AnyTest)	
Name	Template	Context	
noPython	NoPython	Empty	
withAnImage	WithAnImage	"	
onlyExpressions	OnlyExpressions	OnlyExpressions	
simpleIfIsTrue	SimpleIfIsTrue	SimpleIfIsTrue	
simpleIfIsTrue003	SimpleIfIsTrue003	SimpleIfIsTrue	
simpleIfIsFalse	SimpleIfIsFalse	SimpleIfIsFalse	
simpleForEmptyList	SimpleForEmptyList	SimpleForEmptyList	
simpleForFilledList	SimpleForFilledList	SimpleForFilledList	
simpleForRow	SimpleForRow	SimpleForRow	
ifAndFors1	IfAndFors1	IfAndFors1	
forCellCorrectNumber	ForCell	PersonsFour	
forCellNotEnough	"	PersonsThree	
forCellTooMuch1	"	PersonsTwo	
forCellTooMuch2	ForCell2	PersonsThree	
forCellTooMuch3	ForCell3	PersonsTwo	
forCellTooMuch4	ForCell4	PersonsThree	
forCellOnlyOne	ForCell5	PersonsEight	
forCellBug	ForCell6	ForCell6	
forCellBug2	ForCell7	"	
forTable	ForTable	PersonsEight	
forTableMinus	ForTableMinus	"	
forTableMinus2	ForTableMinus2	PersonsTwo	
simpleTest	SimpleTest	SimpleTest	
headerFooter	HeaderFooter	PersonsEight	
simpleFromTest	SimpleFromTest	"	
elseStatements	ElseStatements	ElseStatements	
varDef	VarStatements	VarStatements	
chart1	Chart1	Chart1	
fieldExpression	FieldExpressions	FieldExpressions	
PodXhtml
PodXhtml.descriptions	
Name	Description	
xhtmlNominal	A test with a simple content coming from a Kupu field.	
xhtmlComplex	A test with bold, italics, sup, sub elements; with headings, subheadings, bulleted and numbered lists at several levels.	
xhtmlStylesMapping	Tests the definition of a global styles mapping and local styles mapping. The test applies only to outline-related mappings (h*).	
xhtmlTables	Tests translation of XHTML tables.	
xhtmlComplexTables	Tests translation of complex XHTML tables containing sub-tables, lists, etc.	
xhtmlKeepWithNext	Tests the possibility to define paragraphs and list items (<li>) with an option “Keep with next”. Useful for keeping last paragraphs together with a signature at the bottom of a page, for example (avoid having the signature alone at the top of the last page).	
xhtmlEntities	Tests a content that includes HTML entities.	
xhtmlComplex2	More XHTML cases.	
xhtmlComplex3	Still more XHTML cases.	
xhtmlComplex4	Still more.	
xhtmlComplex5	More more.	
xhtmlComplex6	Tests conflictual elements p->div->p.	
xhmlIgnoreStyles	Checks if POD ignores style information that can come from cut/past operations  from a Word processor to a browser editor like Kupu.	

PodXhtml.data(AnyTest)	
Name	Template	Context	StylesMapping	
xhtmlNominal	Xhtml	XhtmlNominal		
xhtmlComplex	"	XhtmlComplex		
xhtmlStylesMapping	XhtmlStyles	XhtmlStylesMapping	'h*': -1	
xhtmlTables	XhtmlTables	XhtmlTables		
xhtmlComplexTables	XhtmlComplexTables	XhtmlComplexTables		
xhtmlKeepWithNext	XhtmlKeepWithNext	XhtmlKeepWithNext	{'pmParaKeepWithNext': 'pmParaKeepWithNext', 'pmItemKeepWithNext': 'podItemKeepWithNext'}	
xhtmlEntities	XhtmlSimple	XhtmlEntities		
xhtmlComplex2	XhtmlComplex2	XhtmlComplex2		
xhtmlComplex3	XhtmlComplex3	XhtmlComplex3		
xhtmlComplex4	XhtmlComplex4	XhtmlComplex4		
xhtmlComplex5	"	XhtmlComplex5		
xhtmlComplex6	"	XhtmlComplex6		
xhmlIgnoreStyles	XhtmlSimple	XhtmlWithStyle		
PodErrorsInTemplate
PodErrorsInTemplate.descriptions	
Name	Description	
errorExpression	A pod expression produces a Python exception.	
errorIf	A if statement produces a Python exception.	
errorForRuntime	“For” statements produce Python exceptions at “run-time” (ie no syntax error occurred while parsing the “for” statements)	
errorForParsetime	“For” statements produce a Python exception at “parse-time” (ie syntax errors are present in the “for” statements)	
forTableMinusError	A table must be repeated through a for statement with a minus operator, but the table has a row with 2 cells. The minus operator may only be applied to one-cell tables.	
forTableMinusError2	A table must be repeated through a for statement with a minus operator, but the table has two rows. The minus operator may only be applied to one-cell tables.	
simpleMinusError	The “minus” operator is applied on a text.	
xhtmlStylesErrors	Tests some errors on local styles mapping definitions.	
errorFooter	An error is generated in the page footer.	
ifElseErrors	Tests some more errors generated in if/else clauses (“else” without named “if”; “duplicate named if”; “if”expression (function “test”)	

PodErrorsInTemplate.data(AnyTest)	
Name	Template	Context	
errorExpression	ErrorExpression	Empty	
errorIf	ErrorIf	"	
errorForRuntime	ErrorForRuntime	"	
errorForParsetime	ErrorForParsetime	"	
forTableMinusError	ForTableMinusError	PersonsTwo	
forTableMinusError2	ForTableMinusError2	"	
simpleMinusError	SimpleMinusError	SimpleIfIsTrue	
xhtmlStylesErrors	XhtmlStylesErrors	XhtmlStylesErrors	
errorFooter	ErrorFooter	PersonsEight	
ifElseErrors	IfElseErrors	Empty	
PodErrors
PodErrors.descriptions	
Name	Description	
wrongResultType	The specified result type is not supported by pod.	
hStarNotInt	In a global style mapping, a “h*” key does not have an integer value.	
styleNameNotString	In a global style mapping, a style name is not a string.	
itemNone	In a global style mapping, the pair (None, None) is present.	
unstylable	In a global style mapping, the 'li' key is present. But at present with pod you can't specify a given ODT list style. Pod uses its own ODT list style.	
odtStyleNotFound	In a global style mapping, an unexisting ODT style is specified.	
paragraphToText	In a global style mapping, we try to map a “paragraph” style to a “text” style.	
textToParagraph	In a global style mapping, we try to map a “text” style to a “paragraph” style.	

PodErrors.data(ErrorTest)	
Name	Template	Context	StylesMapping	Result	Message:l	
wrongResultType	NoPython	Empty		ort	has a wrong extension-Allowed extensions are	
hStarNotInt	"	"	'h*':'56'	odt	When specifying "h*" as key in the styles mapping, you must specify an integer as value	
styleNameNotString	"	"	'h1': True	"	values must be string	
itemNone	"	"	None: None	"	"	
unstylable	"	"	'li': 'myListStyle'	"	You can't associate a style to element	
odtStyleNotFound	"	"	'h1': 'tutu'	"	style-was not found in your template	
paragraphToText	SimpleTest	"	'h1': 'Internet link'	"	you must associate a paragraph-wide OpenDocument style	
textToParagraph	"	"	'b': 'Text body'	"	you must associate an OpenDocument "text" style	
PodImports
PodImports.descriptions	
Name	Description	
pathImport	Imports the content of another ODT file specified by its path on disk.	
fileHandlerImport	Imports the content of another ODT file given as a file handler.	
imagesImport	Imports the content of images (given as paths) into the ODT result.	

PodImports.data(AnyTest)	
Name	Template	Context	
_pathImport	PathImport	PathImport	
_fileHandlerImport	FileHandlerImport	FileHandlerImport	
_imagesImport	ImagesImport	ImagesImport	

For the moment, the test imagesImport does not work, because in an error message the full path to the Python interpreter is included in the ODT result. Of course, from one machine to the other, this may change, so it breaks the test...
Moreover , tests pathImport and fileHandlerImport will probably fail too because they include absolute pat in error messages, so they are deployment-dependent.