improve unit-testing
use config class which reads from .env file remove obsolete functions update requirements
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user