[tests] Fix kernel module test
This commit is contained in:
parent
bd7ff3c8f1
commit
11ebcee29a
12 changed files with 13 additions and 12 deletions
|
@ -9,7 +9,7 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(''))
|
super().__init__(config, core.widget.Widget(''))
|
||||||
self._paused = False
|
self._paused = False
|
||||||
# Make sure that dunst is currently not paused
|
# Make sure that dunst is currently not paused
|
||||||
|
|
|
@ -29,7 +29,7 @@ import util.format
|
||||||
|
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
widgets = []
|
widgets = []
|
||||||
super().__init__(config, widgets)
|
super().__init__(config, widgets)
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(self.brightness))
|
super().__init__(config, core.widget.Widget(self.brightness))
|
||||||
|
|
||||||
self._brightness = 0
|
self._brightness = 0
|
||||||
|
|
|
@ -15,7 +15,7 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(self.utilization))
|
super().__init__(config, core.widget.Widget(self.utilization))
|
||||||
self.widget().set('theme.minwidth', self._format.format(100.0-10e-20))
|
self.widget().set('theme.minwidth', self._format.format(100.0-10e-20))
|
||||||
self._utilization = psutil.cpu_percent(percpu=False)
|
self._utilization = psutil.cpu_percent(percpu=False)
|
||||||
|
|
|
@ -19,7 +19,7 @@ import core.input
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(self.diskspace))
|
super().__init__(config, core.widget.Widget(self.diskspace))
|
||||||
|
|
||||||
self._path = self.parameter('path', '/')
|
self._path = self.parameter('path', '/')
|
||||||
|
|
|
@ -9,7 +9,7 @@ import core.widget
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.module.every(minutes=60)
|
@core.module.every(minutes=60)
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(self.full_text))
|
super().__init__(config, core.widget.Widget(self.full_text))
|
||||||
|
|
||||||
def full_text(self, widgets):
|
def full_text(self, widgets):
|
||||||
|
|
|
@ -18,7 +18,7 @@ import core.input
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget(self.memory_usage))
|
super().__init__(config, core.widget.Widget(self.memory_usage))
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd='gnome-system-monitor')
|
cmd='gnome-system-monitor')
|
||||||
|
|
|
@ -75,7 +75,7 @@ def get_redshift_value(widget, location, lat, lon):
|
||||||
widget.set('transition', ' '.join(line.split(' ')[2:]))
|
widget.set('transition', ' '.join(line.split(' ')[2:]))
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
widget = core.widget.Widget(self.text)
|
widget = core.widget.Widget(self.text)
|
||||||
super().__init__(config, widget)
|
super().__init__(config, widget)
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import util.cli
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, [])
|
super().__init__(config, [])
|
||||||
|
|
||||||
self.__chip = self.parameter('chip', '')
|
self.__chip = self.parameter('chip', '')
|
||||||
|
|
|
@ -7,7 +7,7 @@ import core.widget
|
||||||
import core.module
|
import core.module
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
super().__init__(config, core.widget.Widget('test'))
|
super().__init__(config, core.widget.Widget('test'))
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
|
@ -33,7 +33,7 @@ except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config=None):
|
def __init__(self, config):
|
||||||
widgets = []
|
widgets = []
|
||||||
super().__init__(config, widgets)
|
super().__init__(config, widgets)
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
import core.config
|
||||||
import modules.core.kernel
|
import modules.core.kernel
|
||||||
|
|
||||||
class kernel(unittest.TestCase):
|
class kernel(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.someKernel = 'this-is-my-kernel'
|
self.someKernel = 'this-is-my-kernel'
|
||||||
self.module = modules.core.kernel.Module()
|
self.module = modules.core.kernel.Module(config=core.config.Config([]))
|
||||||
|
|
||||||
def test_full_text(self):
|
def test_full_text(self):
|
||||||
with unittest.mock.patch('modules.core.kernel.platform') as platform:
|
with unittest.mock.patch('modules.core.kernel.platform') as platform:
|
||||||
|
|
Loading…
Reference in a new issue