improve unit-testing

use config class which reads from .env file
remove obsolete functions
update requirements
This commit is contained in:
aceisace
2023-01-11 22:24:39 +01:00
parent 9fa2f4a003
commit 8e754cb6cd
16 changed files with 237 additions and 197 deletions

View File

@@ -1,18 +1,16 @@
#!python3
"""
Feeds test (inykcal_feeds)
Copyright by aceisace
inkycal_feeds unittest
"""
import logging
import sys
import unittest
from inkycal.modules import Feeds as Module
from helper_functions import *
from inkycal.modules.inky_image import Inkyimage
from inkycal.tests import Config
environment = get_environment()
# Set to True to preview images. Only works on Raspberry Pi OS with Desktop
use_preview = False
preview = Inkyimage.preview
merge = Inkyimage.merge
tests = [
{
@@ -57,7 +55,7 @@ class module_test(unittest.TestCase):
module = Module(test)
im_black, im_colour = module.generate_image()
print('OK')
if use_preview and environment == 'Raspberry':
if Config.USE_PREVIEW:
preview(merge(im_black, im_colour))
im = merge(im_black, im_colour)
im.show()