mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Remove bordered() utility function (#5692)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import asyncio
|
||||
import pytest
|
||||
import random
|
||||
import textwrap
|
||||
from redbot.core.utils import (
|
||||
chat_formatting,
|
||||
bounded_gather,
|
||||
bounded_gather_iter,
|
||||
deduplicate_iterables,
|
||||
@@ -11,60 +9,6 @@ from redbot.core.utils import (
|
||||
)
|
||||
|
||||
|
||||
def test_bordered_symmetrical():
|
||||
expected = textwrap.dedent(
|
||||
"""\
|
||||
┌──────────────┐ ┌─────────────┐
|
||||
│one │ │four │
|
||||
│two │ │five │
|
||||
│three │ │six │
|
||||
└──────────────┘ └─────────────┘"""
|
||||
)
|
||||
col1, col2 = ["one", "two", "three"], ["four", "five", "six"]
|
||||
assert chat_formatting.bordered(col1, col2) == expected
|
||||
|
||||
|
||||
def test_bordered_asymmetrical():
|
||||
expected = textwrap.dedent(
|
||||
"""\
|
||||
┌──────────────┐ ┌──────────────┐
|
||||
│one │ │four │
|
||||
│two │ │five │
|
||||
│three │ │six │
|
||||
└──────────────┘ │seven │
|
||||
└──────────────┘"""
|
||||
)
|
||||
col1, col2 = ["one", "two", "three"], ["four", "five", "six", "seven"]
|
||||
assert chat_formatting.bordered(col1, col2) == expected
|
||||
|
||||
|
||||
def test_bordered_asymmetrical_2():
|
||||
expected = textwrap.dedent(
|
||||
"""\
|
||||
┌──────────────┐ ┌─────────────┐
|
||||
│one │ │five │
|
||||
│two │ │six │
|
||||
│three │ └─────────────┘
|
||||
│four │
|
||||
└──────────────┘ """
|
||||
)
|
||||
col1, col2 = ["one", "two", "three", "four"], ["five", "six"]
|
||||
assert chat_formatting.bordered(col1, col2) == expected
|
||||
|
||||
|
||||
def test_bordered_ascii():
|
||||
expected = textwrap.dedent(
|
||||
"""\
|
||||
+--------------+ +-------------+
|
||||
|one | |four |
|
||||
|two | |five |
|
||||
|three | |six |
|
||||
+--------------+ +-------------+"""
|
||||
)
|
||||
col1, col2 = ["one", "two", "three"], ["four", "five", "six"]
|
||||
assert chat_formatting.bordered(col1, col2, ascii_border=True) == expected
|
||||
|
||||
|
||||
def test_deduplicate_iterables():
|
||||
expected = [1, 2, 3, 4, 5]
|
||||
inputs = [[1, 2, 1], [3, 1, 2, 4], [5, 1, 2]]
|
||||
|
||||
Reference in New Issue
Block a user