2020-06-18 23:22:00 +02:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
import core.config
|
|
|
|
import modules.contrib.kernel
|
|
|
|
|
2020-06-19 09:35:00 +02:00
|
|
|
|
2020-06-18 23:22:00 +02:00
|
|
|
@pytest.fixture
|
|
|
|
def some_kernel():
|
2020-06-19 09:35:00 +02:00
|
|
|
return "this-is-my-kernel"
|
|
|
|
|
2020-06-18 23:22:00 +02:00
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def kernel_module():
|
|
|
|
return modules.contrib.kernel.Module(config=core.config.Config([]), theme=None)
|
|
|
|
|
2020-06-19 09:35:00 +02:00
|
|
|
|
2020-06-18 23:22:00 +02:00
|
|
|
def test_full_text(mocker, kernel_module):
|
2020-06-19 09:35:00 +02:00
|
|
|
platform = mocker.patch("modules.contrib.kernel.platform")
|
2020-06-18 23:22:00 +02:00
|
|
|
platform.release.return_value = some_kernel
|
|
|
|
assert len(kernel_module.widgets()) == 1
|
|
|
|
assert some_kernel == kernel_module.widget().full_text()
|
|
|
|
|
2020-06-19 09:35:00 +02:00
|
|
|
|
2020-06-18 23:22:00 +02:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|