improved tests
This commit is contained in:
parent
a431ffb683
commit
1c68895d94
@ -1,14 +1,15 @@
|
||||
#!python3
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from inkycal.modules import Todoist as Module
|
||||
from helper_functions import *
|
||||
|
||||
environment = get_environment()
|
||||
|
||||
# Set to True to preview images. Only works on Raspberry Pi OS with Desktop
|
||||
use_preview = False
|
||||
|
||||
api_key = ""
|
||||
api_key = os.environ["TODOIST_API_KEY"] or ""
|
||||
|
||||
tests = [
|
||||
{
|
||||
@ -22,6 +23,7 @@ tests = [
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
class module_test(unittest.TestCase):
|
||||
|
||||
def test_get_config(self):
|
||||
@ -36,13 +38,13 @@ class module_test(unittest.TestCase):
|
||||
module = Module(test)
|
||||
im_black, im_colour = module.generate_image()
|
||||
print('OK')
|
||||
if use_preview == True and environment == 'Raspberry':
|
||||
if use_preview and environment == 'Raspberry':
|
||||
preview(merge(im_black, im_colour))
|
||||
else:
|
||||
print('No api key given, omitting test')
|
||||
|
||||
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