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