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
|
|
|
|
|
2020-07-09 10:16:45 +02:00
|
|
|
_LOGGER = logging.getLogger(__name__)
|
2020-03-19 16:45:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
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()
|