i3pystatus/tests/test_core_modules.py
2014-12-18 10:46:53 +01:00

32 lines
1.0 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(IntervalModule):
pass
self.assertTrue('interval' in NoSettings.settings)
def test_no_interval_setting(self):
class NoIntervalSetting(IntervalModule):
settings = (('option', 'desc'),)
self.assertEqual(NoIntervalSetting.settings,
(('option', 'desc'), 'interval'))
def test_settings_with_interval(self):
class SettingsInterval(IntervalModule):
settings = ('option', 'interval')
self.assertEqual(SettingsInterval.settings, ('option', 'interval'))
def test_settings_with_interval_desc(self):
class SetttingsIntervalDesc(IntervalModule):
settings = (('interval', 'desc'),)
self.assertEqual(SetttingsIntervalDesc.settings,
(('interval', 'desc'),))