test_extension.py 941 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # from __future__ import unicode_literals
  2. import unittest
  3. import pygame
  4. from mopidy_touchscreen import Extension
  5. from mopidy_touchscreen.graphic_utils.list_view import ListView
  6. # ,touch_screen as frontend_lib
  7. class ExtensionTest(unittest.TestCase):
  8. def test_get_default_config(self):
  9. ext = Extension()
  10. config = ext.get_default_config()
  11. self.assertIn('[touchscreen]', config)
  12. self.assertIn('enabled = true', config)
  13. def test_get_config_schema(self):
  14. pass
  15. # ext = Extension()
  16. # schema = ext.get_config_schema()
  17. # TODO Test the content of your config schema
  18. # self.assertIn('username', schema)
  19. # self.assertIn('password', schema)
  20. def test_list_view(self):
  21. pygame.init()
  22. font = pygame.font.SysFont("arial", 200/6)
  23. list = ListView((0, 0), (200, 200), 200/6, font)
  24. list.set_list(["item1", "item2", "item3"])