Merge branch 'main' into feature/#311
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -37,7 +37,7 @@ tests = [
|
||||
"size": [500, 800],
|
||||
"ical_urls": sample_url,
|
||||
"ical_files": None,
|
||||
"date_format": "ddd D MMM",
|
||||
"date_format": "DD.MMMM YYYY",
|
||||
"time_format": "HH:mm",
|
||||
"padding_x": 10,
|
||||
"padding_y": 10,
|
||||
|
@@ -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,
|
||||
|
@@ -34,7 +34,7 @@ tests = [
|
||||
"padding_x": 10,
|
||||
"padding_y": 10,
|
||||
"fontsize": 12,
|
||||
"language": "en"
|
||||
"language": "de"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -16,33 +16,13 @@ preview = Inkyimage.preview
|
||||
merge = Inkyimage.merge
|
||||
|
||||
tests = [
|
||||
{
|
||||
"position": 1,
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 100],
|
||||
"url": "https://github.com",
|
||||
"palette": "bwr",
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
},
|
||||
{
|
||||
"position": 1,
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 200],
|
||||
"url": "https://github.com",
|
||||
"palette": "bwy",
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
},
|
||||
{
|
||||
"position": 1,
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 300],
|
||||
"url": "https://github.com",
|
||||
"palette": "bw",
|
||||
"url": "https://aceinnolab.com",
|
||||
"palette": "bwr",
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
},
|
||||
@@ -51,8 +31,31 @@ tests = [
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 400],
|
||||
"url": "https://github.com",
|
||||
"url": "https://aceinnolab.com",
|
||||
"palette": "bwy",
|
||||
"rotation": 0,
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
},
|
||||
{
|
||||
"position": 1,
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 600],
|
||||
"url": "https://aceinnolab.com",
|
||||
"palette": "bw",
|
||||
"rotation": 90,
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
},
|
||||
{
|
||||
"position": 1,
|
||||
"name": "Webshot",
|
||||
"config": {
|
||||
"size": [400, 800],
|
||||
"url": "https://aceinnolab.com",
|
||||
"palette": "bwr",
|
||||
"rotation": 180,
|
||||
"padding_x": 10, "padding_y": 10, "fontsize": 12, "language": "en"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user