can generate the temp png
This commit is contained in:
		| @@ -2,7 +2,12 @@ import requests | ||||
| import json | ||||
| from inkycal.modules.inkycal_vikunja import LoginVikunja | ||||
| from inkycal.modules.inkycal_vikunja import ApiVikunja | ||||
| from inkycal.modules.inkycal_vikunja import Vikunja | ||||
| from inkycal.modules.inky_image import Inkyimage | ||||
| import unittest | ||||
| from tests import Config | ||||
| preview = Inkyimage.preview | ||||
| merge = Inkyimage.merge | ||||
|  | ||||
| class TestLoginVikunja(unittest.TestCase): | ||||
|     def setUp(self) -> None: | ||||
| @@ -25,11 +30,38 @@ class TestApiVikunja(unittest.TestCase): | ||||
|          | ||||
|     def test_get_projects(self): | ||||
|         json_projects = self.api.get_projects() | ||||
|         print(json_projects) | ||||
|         # print(json.dumps(json_projects, indent=4)) | ||||
|         self.assertTrue(json_projects) | ||||
|      | ||||
|     def test_get_tasks(self): | ||||
|         json_tasks = self.api.get_tasks(exclude_completed=True)   | ||||
|         print(json_tasks) | ||||
|         print(json.dumps(json_tasks, indent=4)) | ||||
|         self.assertTrue(json_tasks) | ||||
|      | ||||
|      | ||||
| tests = [ | ||||
|     { | ||||
|         "name": "Vikunja", | ||||
|         "config": { | ||||
|             "size": [400, 1000], | ||||
|             "url-frontend": "http://ff.mhrooz.xyz:8077/", | ||||
|             "url-backend": "http://192.168.50.10:3456/api/v1/", | ||||
|             "username": "iicd", | ||||
|             "password": "9297519Mhz.", | ||||
|             "project_filter": ["LMU", "Master Thesis"], | ||||
|             "padding_x": 10, | ||||
|             "padding_y": 10, | ||||
|             "fontsize": 12, | ||||
|             "language": "en" | ||||
|         } | ||||
|     }, | ||||
| ] | ||||
|  | ||||
| class TestVikunja(unittest.TestCase): | ||||
|     def test_generate_image(self): | ||||
|         for test in tests: | ||||
|             print(f'test {tests.index(test) + 1} generating image..') | ||||
|             module = Vikunja(test) | ||||
|             im_black, im_colour = module.generate_image() | ||||
|             print('OK') | ||||
|             if Config.USE_PREVIEW: | ||||
|                 preview(merge(im_black, im_colour)) | ||||
		Reference in New Issue
	
	Block a user