Fix bug that prevented --format pretty and --format short from working (#1177)

This commit is contained in:
Suhas 2021-03-06 13:47:03 -05:00 committed by GitHub
parent b9a6d029e2
commit a3f4f6b944
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 2 deletions

17
tests/test_color.py Normal file
View file

@ -0,0 +1,17 @@
import pytest
from jrnl.color import colorize
from colorama import Fore, Style
@pytest.fixture()
def data_fixture():
string = "Zwei peanuts walked into a bar"
yield string
def test_colorize(data_fixture):
string = data_fixture
colorized_string = colorize(string, "BLUE", True)
assert colorized_string == Style.BRIGHT + Fore.BLUE + string + Style.RESET_ALL