summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek Wielemborek <d33tah@gmail.com>2015-10-25 20:01:54 +0100
committerJacek Wielemborek <d33tah@gmail.com>2015-10-25 20:01:54 +0100
commit74c67a6dc619d5da6dbff67c1679859c3ac26281 (patch)
treecd2cf05a9708993d832aab0830afbb17db78cd2a
parentf888ff39e4beaf587b02395e55729a0f35b363b8 (diff)
Add a test written by darikg. Not actually executed, please confirm it.
-rw-r--r--tests/test_tabulate.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_tabulate.py b/tests/test_tabulate.py
new file mode 100644
index 00000000..528255d1
--- /dev/null
+++ b/tests/test_tabulate.py
@@ -0,0 +1,14 @@
+from pgcli.packages.tabulate import tabulate
+from textwrap import dedent
+
+
+def test_dont_strip_leading_whitespace():
+ data = [[' abc']]
+ headers = ['xyz']
+ tbl, _ = tabulate(data, headers, tablefmt='psql')
+ assert tbl == dedent('''
+ +---------+
+ | xyz |
+ |---------|
+ | abc |
+ +---------+ ''').strip()