plugin.video.viervijfzes/test/test_search.py

38 lines
1013 B
Python
Raw Normal View History

2020-03-19 16:45:31 +01:00
# -*- coding: utf-8 -*-
""" Tests for EPG API """
# pylint: disable=missing-docstring,no-self-use
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import unittest
from resources.lib.viervijfzes.content import Program
from resources.lib.viervijfzes.search import SearchApi
_LOGGER = logging.getLogger('test-search')
class TestSearch(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestSearch, self).__init__(*args, **kwargs)
2020-03-22 10:30:23 +01:00
self._search = SearchApi()
2020-03-19 16:45:31 +01:00
def test_search(self):
2020-03-22 10:30:23 +01:00
programs = self._search.search('de mol')
2020-03-19 16:45:31 +01:00
self.assertIsInstance(programs, list)
self.assertIsInstance(programs[0], Program)
def test_search_empty(self):
2020-03-22 10:30:23 +01:00
programs = self._search.search('')
2020-03-19 16:45:31 +01:00
self.assertIsInstance(programs, list)
def test_search_space(self):
2020-03-22 10:30:23 +01:00
programs = self._search.search(' ')
2020-03-19 16:45:31 +01:00
self.assertIsInstance(programs, list)
if __name__ == '__main__':
unittest.main()