From 25da44f56980ac8ddc7aa4b034ab0ec9a1ebd5e7 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 21 Nov 2010 13:00:56 +0100 Subject: Support for HTML (export only). Unit-tested. Depends on the "markup.py" package(http://markup.sourceforge.net) which is included in packages/ Notice that the tests now depend on the presence of markup.py. --- test_tablib.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test_tablib.py') diff --git a/test_tablib.py b/test_tablib.py index 8e2454f..bc660fe 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -5,6 +5,7 @@ import unittest +import markup import tablib @@ -182,6 +183,27 @@ class TablibTestCase(unittest.TestCase): self.assertEqual(tsv, self.founders.tsv) + def test_html_export(self): + + """HTML export""" + + html = markup.page() + html.table.open() + html.thead.open() + + html.tr(markup.oneliner.th(self.founders.headers)) + html.thead.close() + + for founder in self.founders: + + html.tr(markup.oneliner.td(founder)) + + html.table.close() + html = str(html) + + self.assertEqual(html, self.founders.html) + + def test_unicode_append(self): """Passes in a single unicode charecter and exports.""" @@ -403,6 +425,7 @@ class TablibTestCase(unittest.TestCase): ("John", "Adams", 90, "John", "Adams", 90)) + def test_wipe(self): """Purge a dataset.""" -- cgit v1.2.1