From 7c4fa9357f410166eff80cfb0cf6cf11a82789df Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 29 May 2020 03:58:48 +0200 Subject: [PATCH] updated tests --- inkycal/tests/ical_parser_test.py | 25 ++++++++++++++++++------- inkycal/tests/inkycal_agenda_test.py | 26 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 inkycal/tests/inkycal_agenda_test.py diff --git a/inkycal/tests/ical_parser_test.py b/inkycal/tests/ical_parser_test.py index 4e9ccdd..ebe7830 100644 --- a/inkycal/tests/ical_parser_test.py +++ b/inkycal/tests/ical_parser_test.py @@ -1,15 +1,26 @@ import unittest -from inkycal.modules.ical_parser import icalendar +from inkycal.modules.ical_parser import iCalendar import arrow +ical = iCalendar() class ical_parser_test(unittest.TestCase): + + def test_load_url(self): + print('testing loading via URL') + ical.load_url('https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics') - def test_show_events(self): - a = icalendar() - a.load_url('https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics') - a.get_events(arrow.now(), arrow.now().shift(weeks=30)) - a.show_events() + def test_get_events(self): + print('testing parsing of events') + ical.get_events(arrow.now(), arrow.now().shift(weeks=30)) + + def test_sorting(self): + print('testing sorting of events') + ical.sort() + + def test_show_events(self): + print('testing if events can be shown') + ical.show_events() if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/inkycal/tests/inkycal_agenda_test.py b/inkycal/tests/inkycal_agenda_test.py new file mode 100644 index 0000000..35be69b --- /dev/null +++ b/inkycal/tests/inkycal_agenda_test.py @@ -0,0 +1,26 @@ +import unittest +from inkycal.modules.inkycal_agenda import agenda +#import arrow + +agenda = agenda() + +class inkycal_agenda_test(unittest.TestCase): + +## def test_load_url(self): +## print('testing loading via URL') +## ical.load_url('https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics') +## +## def test_get_events(self): +## print('testing parsing of events') +## ical.get_events(arrow.now(), arrow.now().shift(weeks=30)) +## +## def test_sorting(self): +## print('testing sorting of events') +## ical.sort() +## +## def test_show_events(self): +## print('testing if events can be shown') +## ical.show_events() + +if __name__ == '__main__': + unittest.main()