def testStringParser(self): p = XMLParser(xmlcontent=wrong_xml) p = XMLParser(xmlcontent=simple_xml) report = p.parse() datasource = range(86) r = PDFRenderer(report) r.render(datasources=[dataproviders.DataProvider(datasource)], outfile="out/%s.pdf" % self._testMethodName)
def testFileParser(self): conn = sqlite3.connect(":memory:") cur = conn.cursor() cur.execute( "CREATE TABLE test_table(id int not null primary key, description varchar(50))" ) for x in range(50): cur.execute("INSERT INTO test_table(id, description) values(?, ?)", (x, "Desc %s" % (x + 1))) conn.commit() cur.close() p = XMLParser(filename="test1.xml") report = p.parse() r = PDFRenderer(report) r.render(module=sqlite3, conn=conn, outfile="out/%s.pdf" % self._testMethodName)