[core] fix tests
This commit is contained in:
parent
dd4294ecfa
commit
9ef826b5fd
3 changed files with 5 additions and 5 deletions
|
@ -74,7 +74,7 @@ class config(unittest.TestCase):
|
|||
with unittest.mock.patch("core.config.sys") as sys:
|
||||
cfg = core.config.Config(["-l", "themes"])
|
||||
cfg = core.config.Config(["-l", "modules"])
|
||||
cfg = core.config.Config(["-l", "modules-markdown"])
|
||||
cfg = core.config.Config(["-l", "modules-rst"])
|
||||
# TODO: think of some plausibility testing here
|
||||
|
||||
def test_missing_parameter(self):
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import unittest
|
||||
|
||||
import core.config
|
||||
import modules.core.kernel
|
||||
import modules.contrib.kernel
|
||||
|
||||
|
||||
class kernel(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.someKernel = "this-is-my-kernel"
|
||||
self.module = modules.core.kernel.Module(
|
||||
self.module = modules.contrib.kernel.Module(
|
||||
config=core.config.Config([]), theme=None
|
||||
)
|
||||
|
||||
def test_full_text(self):
|
||||
with unittest.mock.patch("modules.core.kernel.platform") as platform:
|
||||
with unittest.mock.patch("modules.contrib.kernel.platform") as platform:
|
||||
platform.release.return_value = self.someKernel
|
||||
self.assertEqual(1, len(self.module.widgets()))
|
||||
self.assertEqual(self.someKernel, self.module.widget().full_text())
|
||||
|
|
|
@ -66,7 +66,7 @@ def astemperature(val, unit="metric"):
|
|||
:return: temperature representation of the input value
|
||||
:rtype: string
|
||||
"""
|
||||
return "{}°{}".format(int(value), __UNITS.get(unit, __UNITS["default"]))
|
||||
return "{}°{}".format(int(val), __UNITS.get(unit, __UNITS["default"]))
|
||||
|
||||
|
||||
def byte(val, fmt="{:.2f}"):
|
||||
|
|
Loading…
Reference in a new issue