Skip to content

Commit

Permalink
Merge pull request #2786 from andrehora/master
Browse files Browse the repository at this point in the history
improving tests in test_cells and test_pick
  • Loading branch information
willmcgugan committed Mar 4, 2023
2 parents 465d0ae + 6159830 commit 3588894
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following people have contributed to the development of Rich:
- [Michał Górny](https://github.com/mgorny)
- [Nok Lam Chan](https://github.com/noklam)
- [Leron Gray](https://github.com/daddycocoaman)
- [Andre Hora](https://github.com/andrehora)
- [Kenneth Hoste](https://github.com/boegel)
- [Lanqing Huang](https://github.com/lqhuang)
- [Finn Hughes](https://github.com/finnhughes)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
def test_cell_len_long_string():
# Long strings don't use cached cell length implementation
assert cells.cell_len("abc" * 200) == 3 * 200
# Boundary case
assert cells.cell_len("a" * 512) == 512


def test_cell_len_short_string():
# Short strings use cached cell length implementation
assert cells.cell_len("abc" * 100) == 3 * 100
# Boundary case
assert cells.cell_len("a" * 511) == 511


def test_set_cell_size():
Expand Down
3 changes: 3 additions & 0 deletions tests/test_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


def test_pick_bool():
assert pick_bool(False) == False
assert pick_bool(True) == True
assert pick_bool(None) == False
assert pick_bool(False, True) == False
assert pick_bool(None, True) == True
assert pick_bool(True, None) == True
Expand Down

0 comments on commit 3588894

Please sign in to comment.