From 85eb39ab4f2a44b92d1c4eec66e7a7560da08e24 Mon Sep 17 00:00:00 2001 From: Gerome Fournier Date: Mon, 24 Jun 2019 14:21:38 +0200 Subject: [PATCH] Add test for NaN auto-format --- tests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests.py b/tests.py index 8367022..f02e0c4 100644 --- a/tests.py +++ b/tests.py @@ -288,3 +288,18 @@ def test_chaining(): .add_rows([list('ghi')], False) .draw()) assert s1 == s2 + +def test_nan(): + table = Texttable() + table.set_cols_align(["l"]) + table.add_rows([ + ["A NaN"], + ["NaN"], + ]) + assert clean(table.draw()) == u_dedent('''\ + +-------+ + | A NaN | + +=======+ + | NaN | + +-------+ + ''')