fix test
This commit is contained in:
parent
442961d1ef
commit
40c0f5ff58
@ -4,17 +4,35 @@
|
||||
Slideshow test (inkycal_slideshow)
|
||||
Copyright by aceisace
|
||||
"""
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import requests
|
||||
from PIL import Image
|
||||
|
||||
from inkycal.modules import Slideshow as Module
|
||||
from inkycal.custom import top_level
|
||||
from helper_functions import *
|
||||
|
||||
environment = get_environment()
|
||||
|
||||
# Set to True to preview images. Only works on Raspberry Pi OS with Desktop
|
||||
use_preview = False
|
||||
|
||||
test_path = f'{top_level}/Gallery'
|
||||
if not os.path.exists("tmp"):
|
||||
os.mkdir("tmp")
|
||||
|
||||
im_urls = [
|
||||
"https://github.com/aceisace/Inkycal/raw/assets/Repo/coffee.png",
|
||||
"https://github.com/aceisace/Inkycal/raw/assets/Repo/coffee.png"
|
||||
]
|
||||
|
||||
for count, url in enumerate(im_urls):
|
||||
im = Image.open(requests.get(url, stream=True).raw)
|
||||
im.save(f"tmp/{count}.png", "PNG")
|
||||
|
||||
test_path = "tmp"
|
||||
|
||||
|
||||
tests = [
|
||||
{
|
||||
@ -97,6 +115,7 @@ tests = [
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
class module_test(unittest.TestCase):
|
||||
def test_get_config(self):
|
||||
print('getting data for web-ui...', end="")
|
||||
@ -129,8 +148,8 @@ class module_test(unittest.TestCase):
|
||||
|
||||
print('OK')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
if __name__ == '__main__':
|
||||
logger = logging.getLogger()
|
||||
logger.level = logging.DEBUG
|
||||
logger.addHandler(logging.StreamHandler(sys.stdout))
|
||||
|
Loading…
Reference in New Issue
Block a user