| 
									
										
										
										
											2020-05-29 03:58:48 +02:00
										 |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2020-11-10 22:48:04 +01:00
										 |  |  | from inkycal.modules import Agenda as Module | 
					
						
							| 
									
										
										
										
											2020-05-29 03:58:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-12 10:14:57 +01:00
										 |  |  | tests = [ | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2020-11-10 22:48:04 +01:00
										 |  |  |   "position": 1, | 
					
						
							|  |  |  |   "name": "Agenda", | 
					
						
							|  |  |  |   "config": { | 
					
						
							|  |  |  |     "size": [880,100], | 
					
						
							| 
									
										
										
										
											2020-11-12 10:14:57 +01:00
										 |  |  |       "ical_urls": "https://www.officeholidays.com/ics-fed/usa", | 
					
						
							|  |  |  |       "ical_files": None, | 
					
						
							| 
									
										
										
										
											2020-11-10 22:48:04 +01:00
										 |  |  |       "date_format": "ddd D MMM", | 
					
						
							|  |  |  |       "time_format": "HH:mm", | 
					
						
							|  |  |  |       "padding_x": 10, | 
					
						
							|  |  |  |       "padding_y": 10, | 
					
						
							|  |  |  |       "fontsize": 12, | 
					
						
							|  |  |  |       "language": "en" | 
					
						
							| 
									
										
										
										
											2020-06-10 15:12:44 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-11-12 10:14:57 +01:00
										 |  |  | }, | 
					
						
							|  |  |  | ] | 
					
						
							| 
									
										
										
										
											2020-05-29 03:58:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-19 20:16:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 22:48:04 +01:00
										 |  |  | class module_test(unittest.TestCase): | 
					
						
							|  |  |  |   def test_get_config(self): | 
					
						
							| 
									
										
										
										
											2020-11-12 10:14:57 +01:00
										 |  |  |     print('getting data for web-ui...', end = "") | 
					
						
							|  |  |  |     Module.get_config() | 
					
						
							|  |  |  |     print('OK') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-10 15:12:44 +02:00
										 |  |  |   def test_generate_image(self): | 
					
						
							| 
									
										
										
										
											2020-11-12 10:14:57 +01:00
										 |  |  |     for test in tests: | 
					
						
							|  |  |  |       print(f'test {tests.index(test)+1} generating image..') | 
					
						
							|  |  |  |       module = Module(test) | 
					
						
							|  |  |  |       module.generate_image() | 
					
						
							|  |  |  |       print('OK') | 
					
						
							| 
									
										
										
										
											2020-05-29 03:58:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == '__main__': | 
					
						
							|  |  |  |   unittest.main() |