Code cleanup, adapting modules for new web-ui
This commit is contained in:
@@ -1,27 +1,32 @@
|
||||
import unittest
|
||||
from inkycal.modules import Agenda
|
||||
from inkycal.modules import Agenda as Module
|
||||
|
||||
agenda = Agenda(
|
||||
#size
|
||||
(400,400),
|
||||
|
||||
# common config
|
||||
{
|
||||
'language': 'en',
|
||||
'units': 'metric',
|
||||
'hours': 24,
|
||||
# module-specific config
|
||||
'week_starts_on': 'Monday',
|
||||
'ical_urls': ['https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics']
|
||||
test = {
|
||||
"position": 1,
|
||||
"name": "Agenda",
|
||||
"config": {
|
||||
"size": [880,100],
|
||||
"ical_urls": "https://www.officeholidays.com/ics-fed/usa", "ical_files": "",
|
||||
"date_format": "ddd D MMM",
|
||||
"time_format": "HH:mm",
|
||||
"padding_x": 10,
|
||||
"padding_y": 10,
|
||||
"fontsize": 12,
|
||||
"language": "en"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
class inkycal_agenda_test(unittest.TestCase):
|
||||
module = Module(test)
|
||||
|
||||
class module_test(unittest.TestCase):
|
||||
def test_get_config(self):
|
||||
print('getting data for web-ui')
|
||||
module.get_config()
|
||||
|
||||
def test_generate_image(self):
|
||||
print('testing image generation')
|
||||
agenda.generate_image()
|
||||
|
||||
module.generate_image()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@@ -1,26 +1,34 @@
|
||||
import unittest
|
||||
from inkycal.modules import Calendar
|
||||
from inkycal.modules import Calendar as Module
|
||||
|
||||
calendar = Calendar(
|
||||
#size
|
||||
(400,400),
|
||||
test = {
|
||||
"position": 2,
|
||||
"name": "Calendar",
|
||||
"config": {
|
||||
"size": [880,343],
|
||||
"week_starts_on": "Monday",
|
||||
"show_events": "True",
|
||||
"ical_urls": "https://www.officeholidays.com/ics-fed/usa",
|
||||
"ical_files": "",
|
||||
"date_format": "D MMM",
|
||||
"time_format": "HH:mm",
|
||||
"padding_x": 10,
|
||||
"padding_y": 10,
|
||||
"fontsize": 12,
|
||||
"language": "en"
|
||||
}
|
||||
}
|
||||
|
||||
# common config
|
||||
{
|
||||
'language': 'en',
|
||||
'units': 'metric',
|
||||
'hours': 24,
|
||||
# module-specific config
|
||||
'week_starts_on': 'Monday',
|
||||
'ical_urls': ['https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics']
|
||||
}
|
||||
)
|
||||
module = Module(test)
|
||||
|
||||
class module_test(unittest.TestCase):
|
||||
def test_get_config(self):
|
||||
print('getting data for web-ui')
|
||||
module.get_config()
|
||||
|
||||
class inkycal_calendar_test(unittest.TestCase):
|
||||
def test_generate_image(self):
|
||||
print('testing image generation')
|
||||
calendar.generate_image()
|
||||
|
||||
module.generate_image()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
30
inkycal/tests/inkycal_feeds_test.py
Normal file
30
inkycal/tests/inkycal_feeds_test.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
from inkycal.modules import Feeds as Module
|
||||
|
||||
test = {
|
||||
"position": 1,
|
||||
"name": "Feeds",
|
||||
"config": {
|
||||
"size": [400,100],
|
||||
"feed_urls": "http://feeds.bbci.co.uk/news/world/rss.xml#",
|
||||
"shuffle_feeds": "True",
|
||||
"padding_x": 10,
|
||||
"padding_y": 10,
|
||||
"fontsize": 12,
|
||||
"language": "en"
|
||||
}
|
||||
}
|
||||
|
||||
module = Module(test)
|
||||
|
||||
class module_test(unittest.TestCase):
|
||||
def test_get_config(self):
|
||||
print('getting data for web-ui')
|
||||
module.get_config()
|
||||
|
||||
def test_generate_image(self):
|
||||
print('testing image generation')
|
||||
module.generate_image()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@@ -1,26 +0,0 @@
|
||||
import unittest
|
||||
from inkycal.modules import RSS
|
||||
|
||||
rss = RSS(
|
||||
#size
|
||||
(400,400),
|
||||
|
||||
# common onfig
|
||||
{
|
||||
'language': 'en',
|
||||
'units': 'metric',
|
||||
'hours': 24,
|
||||
# module-specific config
|
||||
'rss_urls': ['http://feeds.bbci.co.uk/news/world/rss.xml#']
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
class inkycal_rss_test(unittest.TestCase):
|
||||
def test_generate_image(self):
|
||||
print('testing image generation')
|
||||
rss.generate_image()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
2
inkycal/tests/inkycal_todo.py
Normal file
2
inkycal/tests/inkycal_todo.py
Normal file
@@ -0,0 +1,2 @@
|
||||
import unittest
|
||||
from inkycal.modules import Todoist as Module
|
Reference in New Issue
Block a user