From 7e07078438652b737f8577bb2c9390ea8c623f6d Mon Sep 17 00:00:00 2001 From: Lari Liuhamo Date: Tue, 19 Sep 2023 01:22:12 +0300 Subject: [PATCH] [PATCH] Made the unit tests a bit more intresting --- tests/conftest.py | 96 ++++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 4744a3c..cbf2ebf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,15 +7,17 @@ def red_foreground_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Hello, world!", + "I'm really feeling it!", + ) + return [ ( - "Hello, world!", - "\x1b[31;49mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[31;49mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[31;49m{message}\x1b[0m", + ) + for message in messages ] @@ -23,15 +25,17 @@ def red_foreground_example_text() -> list[tuple[str, str]]: def green_foreground_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Tempus edax rerum.", + "Time, the devourer of all things.", + ) + return [ ( - "Hello, world!", - "\x1b[32;49mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[32;49mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[32;49m{message}\x1b[0m", + ) + for message in messages ] @@ -39,15 +43,17 @@ def green_foreground_example_text() -> list[tuple[str, str]]: def blue_foreground_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Oderint dum metuant.", + "Let them hate so long as they fear.", + ) + return [ ( - "Hello, world!", - "\x1b[34;49mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[34;49mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[34;49m{message}\x1b[0m", + ) + for message in messages ] @@ -55,15 +61,17 @@ def blue_foreground_example_text() -> list[tuple[str, str]]: def red_background_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Sic semper tyrannis.", + "Thus always to tyrants.", + ) + return [ ( - "Hello, world!", - "\x1b[39;41mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[39;41mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[39;41m{message}\x1b[0m", + ) + for message in messages ] @@ -71,15 +79,17 @@ def red_background_example_text() -> list[tuple[str, str]]: def green_background_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Vincit qui se vincit.", + "He conquers who conquers himself.", + ) + return [ ( - "Hello, world!", - "\x1b[39;42mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[39;42mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[39;42m{message}\x1b[0m", + ) + for message in messages ] @@ -87,13 +97,15 @@ def green_background_example_text() -> list[tuple[str, str]]: def blue_background_example_text() -> list[tuple[str, str]]: """Returns a list of tuples containing a string and an expected result""" + messages = ( + "Astra inclinant, sed non obligant.", + "The stars incline us, they do not bind us.", + ) + return [ ( - "Hello, world!", - "\x1b[39;44mHello, world!\x1b[0m", - ), - ( - "I'm really feeling it!", - "\x1b[39;44mI'm really feeling it!\x1b[0m", - ), + message, + f"\x1b[39;44m{message}\x1b[0m", + ) + for message in messages ]