Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 20, 2024
1 parent df8f2e6 commit 9271d30
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_colortable.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,21 @@ def test_multiple(self) -> None:


class TestColorTableRendering:
""" Tests for the rendering of the color table
"""Tests for the rendering of the color table
Methods
-------
test_color_table_rendering
Tests the color table rendering using the default alignment (`'c'`)
"""

def test_color_table_rendering(self) -> None:
""" Tests the color table rendering using the default alignment (`'c'`) """
"""Tests the color table rendering using the default alignment (`'c'`)"""
chars = {
"+": "\x1b[36m+\x1b[0m\x1b[96m",
"-": "\x1b[34m-\x1b[0m\x1b[96m",
"|": "\x1b[34m|\x1b[0m\x1b[96m",
" ": " "
" ": " ",
}

plus = chars.get("+")
Expand All @@ -127,15 +128,15 @@ def test_color_table_rendering(self) -> None:
# +---+---+---+---+---+---+

header = (
plus + minus * 23 + plus,
plus + minus * 23 + plus,
pipe + space * 8 + "Efforts" + space * 8 + pipe,
(plus + minus * 3) * 6 + plus
(plus + minus * 3) * 6 + plus,
)

body = (
"".join((pipe + space + char + space for char in "ABCDEF")) + pipe,
"".join(pipe + space + char + space for char in "ABCDEF") + pipe,
(plus + minus * 3) * 6 + plus,
"".join((pipe + space + char + space for char in "123456")) + pipe,
"".join(pipe + space + char + space for char in "123456") + pipe,
(plus + minus * 3) * 6 + plus,
)

Expand All @@ -150,7 +151,7 @@ def test_color_table_rendering(self) -> None:
table.title = "Efforts"
table.add_row([1, 2, 3, 4, 5, 6])

expected = header_str + "\n" + body_str + '\x1b[0m'
expected = header_str + "\n" + body_str + "\x1b[0m"
result = str(table)

assert expected == result

0 comments on commit 9271d30

Please sign in to comment.