Merge pull request #43 from jedrz/configurable-interval-tests

Add tests for adding interval setting automatically
This commit is contained in:
enkore 2014-03-12 20:56:22 +01:00
commit 8a6560897e

View File

@ -0,0 +1,31 @@
#!/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.assertEqual(NoSettings.settings, ('interval',))
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 SettingsInteval(IntervalModule):
settings = ('option', 'interval')
self.assertEqual(SettingsInteval.settings, ('option', 'interval'))
def test_settings_with_interval_desc(self):
class SetttingsIntervalDesc(IntervalModule):
settings = (('interval', 'desc'),)
self.assertEqual(SetttingsIntervalDesc.settings,
(('interval', 'desc'),))