Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Robpol86 committed May 31, 2016
1 parent 09c2a30 commit da39056
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/test_base_table/test_table.py
Expand Up @@ -56,6 +56,54 @@ def test_int():
assert actual == expected


def test_float():
"""Test with floats instead of strings."""
table_data = [
[1.0, 22.0, 333.0],
[0.1, 3.1, 6.1],
[1.1, 4.1, 7.1],
[2.1, 5.1, 8.1],
]
table = BaseTable(table_data, 0.12345678)
actual = table.table

expected = (
'+0.12345678--+-------+\n'
'| 1.0 | 22.0 | 333.0 |\n'
'+-----+------+-------+\n'
'| 0.1 | 3.1 | 6.1 |\n'
'| 1.1 | 4.1 | 7.1 |\n'
'| 2.1 | 5.1 | 8.1 |\n'
'+-----+------+-------+'
)

assert actual == expected


def test_bool_none():
"""Test with NoneType/boolean instead of strings."""
table_data = [
[True, False, None],
[True, False, None],
[False, None, True],
[None, True, False],
]
table = BaseTable(table_data, True)
actual = table.table

expected = (
'+True---+-------+-------+\n'
'| True | False | None |\n'
'+-------+-------+-------+\n'
'| True | False | None |\n'
'| False | None | True |\n'
'| None | True | False |\n'
'+-------+-------+-------+'
)

assert actual == expected


def test_cjk():
"""Test with CJK characters."""
table_data = [
Expand Down

0 comments on commit da39056

Please sign in to comment.