From bee5bd992754e41a5edb15ab88a7123b0ced029d Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Mon, 28 Sep 2020 23:40:22 +0200 Subject: [PATCH] Improve coverage (#818) This properly indents addon.xml and adds missing coverage. --- addon.xml | 74 +++++++++++++++++++------------------- resources/lib/apihelper.py | 1 - tests/test_routing.py | 16 +++++++++ 3 files changed, 53 insertions(+), 38 deletions(-) diff --git a/addon.xml b/addon.xml index dfc2833a..c2a7fab6 100644 --- a/addon.xml +++ b/addon.xml @@ -1,20 +1,20 @@ - - - - - - - - - - video - - - - Watch videos from VRT NU - VRT NU is the video-on-demand platform of the Flemish public broadcaster (VRT). + + + + + + + + + + video + + + + Watch videos from VRT NU + VRT NU is the video-on-demand platform of the Flemish public broadcaster (VRT). - Track the programs you like - List all videos alphabetically by program, category, channel or feature @@ -23,9 +23,9 @@ - Browse the online TV guides or search VRT NU [I]The VRT NU add-on is not endorsed by VRT, and is provided 'as is' without any warranty of any kind.[/I] - The VRT NU add-on is not endorsed by VRT, and is provided 'as is' without any warranty of any kind. - VRT NU videos bekijken. - VRT NU is het video-on-demand platform van de Vlaamse publieke omroep (VRT). + The VRT NU add-on is not endorsed by VRT, and is provided 'as is' without any warranty of any kind. + VRT NU videos bekijken. + VRT NU is het video-on-demand platform van de Vlaamse publieke omroep (VRT). - Volg je favoriete tv-programma's - Raadpleeg video's op basis van programma, categorie, kanaal of feature @@ -34,14 +34,14 @@ - Doorblader de online tv-gids of doorzoek VRT NU [I]Deze VRT NU add-on wordt niet ondersteund door de VRT, en wordt aangeboden 'as is', zonder enige garantie.[/I] - Deze VRT NU add-on wordt niet ondersteund door de VRT, en wordt aangeboden 'as is', zonder enige garantie. - en nl - all - GPL-3.0-only - https://www.facebook.com/kodivrtnu/ - https://github.com/add-ons/plugin.video.vrt.nu/wiki - https://github.com/add-ons/plugin.video.vrt.nu - + Deze VRT NU add-on wordt niet ondersteund door de VRT, en wordt aangeboden 'as is', zonder enige garantie. + en nl + all + GPL-3.0-only + https://www.facebook.com/kodivrtnu/ + https://github.com/add-ons/plugin.video.vrt.nu/wiki + https://github.com/add-ons/plugin.video.vrt.nu + v2.4.0 (2020-07-18) - Show error messages when connections fail - Improve user authentication cache @@ -80,15 +80,15 @@ v2.3.1 (2020-01-14) - Small fix for livestreams - Improvements to metadata handling specific to Kodi rendering - Support multiple YouTube links per channel - - - resources/media/icon.png - resources/media/fanart.png - resources/media/screenshot01.jpg - resources/media/screenshot02.jpg - resources/media/screenshot03.jpg - resources/media/screenshot04.jpg - - true - + + + resources/media/icon.png + resources/media/fanart.png + resources/media/screenshot01.jpg + resources/media/screenshot02.jpg + resources/media/screenshot03.jpg + resources/media/screenshot04.jpg + + true + diff --git a/resources/lib/apihelper.py b/resources/lib/apihelper.py index d9fb1ef0..89f72bcd 100644 --- a/resources/lib/apihelper.py +++ b/resources/lib/apihelper.py @@ -78,7 +78,6 @@ def list_tvshows(self, category=None, channel=None, feature=None, use_favorites= def tvshow_to_listitem(self, tvshow, program, cache_file): """Return a ListItem based on a Suggests API result""" - label = self._metadata.get_label(tvshow) if program: diff --git a/tests/test_routing.py b/tests/test_routing.py index 2a725c54..8410a5c4 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -265,6 +265,22 @@ def test_play_upnext_route(self): addon.run(['plugin://plugin.video.vrt.nu/play/upnext/vid-a39ab219-9598-4a79-b676-98b724cceff1', '0', '']) self.assertEqual(plugin.url_for(addon.play_upnext, video_id='vid-a39ab219-9598-4a79-b676-98b724cceff1'), 'plugin://plugin.video.vrt.nu/play/upnext/vid-a39ab219-9598-4a79-b676-98b724cceff1') + def test_play_whatson_id(self): + """Play video by whatsonid method: /play/whatson/""" + # Pano S2018E05 is available until 9999-12-31 + addon.run(['plugin://plugin.video.vrt.nu/play/whatson/490431755527', '0', '']) + self.assertEqual(plugin.url_for(addon.play_whatson_id, whatson_id='490431755527'), 'plugin://plugin.video.vrt.nu/play/whatson/490431755527') + + def test_update_repos(self): + """Update repositories: /update/repos""" + addon.run(['plugin://plugin.video.vrt.nu/update/repos', '0', '']) + self.assertEqual(plugin.url_for(addon.update_repos), 'plugin://plugin.video.vrt.nu/update/repos') + + def test_show_settings_addons(self): + """Open the Kodi System settings: /show/settings/addons""" + addon.run(['plugin://plugin.video.vrt.nu/show/settings/addons', '0', '']) + self.assertEqual(plugin.url_for(addon.show_settings_addons), 'plugin://plugin.video.vrt.nu/show/settings/addons') + if __name__ == '__main__': unittest.main()