test_ui.py 517 B

1234567891011121314151617181920
  1. """ Unit test for reportbug.ui module """
  2. import unittest2
  3. from reportbug import utils
  4. from reportbug import ui
  5. from reportbug.ui import __LOADED_UIS as LOADED_UIS
  6. class TestUI(unittest2.TestCase):
  7. def test_ui(self):
  8. self.assertItemsEqual(ui.AVAILABLE_UIS, ['text', 'urwid', 'gtk2'])
  9. def test_getUI(self):
  10. for loaded_ui in LOADED_UIS.keys():
  11. self.assertEqual(ui.getUI(loaded_ui), LOADED_UIS[loaded_ui])
  12. self.assertEqual(ui.getUI('non-existing'), LOADED_UIS['text'])