From b6631b4882b8d5ed883b33fda87a73d048c63274 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 11 May 2020 00:37:12 +0200 Subject: [PATCH] Add a test for service_log --- src/yunohost/tests/test_service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/yunohost/tests/test_service.py b/src/yunohost/tests/test_service.py index d8660c1e5..e968ac0a7 100644 --- a/src/yunohost/tests/test_service.py +++ b/src/yunohost/tests/test_service.py @@ -1,8 +1,8 @@ import os -from conftest import message, raiseYunohostError +from conftest import raiseYunohostError -from yunohost.service import _get_services, _save_services, service_status, service_add, service_remove +from yunohost.service import _get_services, _save_services, service_status, service_add, service_remove, service_log def setup_function(function): @@ -42,6 +42,13 @@ def test_service_status_single(): assert status["status"] == "running" +def test_service_log(): + + logs = service_log("ssh") + assert "journalctl" in logs.keys() + assert "/var/log/auth.log" in logs.keys() + + def test_service_status_unknown_service(mocker): with raiseYunohostError(mocker, 'service_unknown'):