fix an issue where the text would not be vertically centered

This commit is contained in:
Ace
2024-06-22 02:03:48 +02:00
parent e6ebbb293c
commit acc4fb7ce6
4 changed files with 68 additions and 56 deletions

View File

@@ -1,12 +1,22 @@
"""
Test the functions in the functions module.
"""
import unittest
from PIL import Image, ImageFont
from inkycal.custom import write, fonts
from inkycal.custom import write, fonts, get_system_tz
def test_write():
im = Image.new("RGB", (500, 200), "white")
font = ImageFont.truetype(fonts['NotoSans-SemiCondensed'], size = 40)
write(im, (125,75), (250, 50), "Hello World", font)
# im.show()
class TestIcalendar(unittest.TestCase):
def test_write(self):
im = Image.new("RGB", (500, 200), "white")
font = ImageFont.truetype(fonts['NotoSans-SemiCondensed'], size=40)
write(im, (125, 75), (250, 50), "Hello World", font)
# im.show()
def test_get_system_tz(self):
tz = get_system_tz()
assert isinstance(tz, str)

View File

@@ -20,7 +20,7 @@ tests = [
{
"name": "Calendar",
"config": {
"size": [500, 500],
"size": [500, 600],
"week_starts_on": "Monday",
"show_events": True,
"ical_urls": sample_url,