diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-25 02:59:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-25 02:59:47 +0000 |
commit | 03a1bd448be99d872d663a57a1cf4492882e090d (patch) | |
tree | c3d23691aa4dfdba89856bde05707a9a8e16abab /tests/test_debputy_plugin.py | |
parent | Adding upstream version 0.1.28. (diff) | |
download | debputy-03a1bd448be99d872d663a57a1cf4492882e090d.tar.xz debputy-03a1bd448be99d872d663a57a1cf4492882e090d.zip |
Adding upstream version 0.1.29.upstream/0.1.29
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_debputy_plugin.py')
-rw-r--r-- | tests/test_debputy_plugin.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/test_debputy_plugin.py b/tests/test_debputy_plugin.py index a5d7758..dc60597 100644 --- a/tests/test_debputy_plugin.py +++ b/tests/test_debputy_plugin.py @@ -1,6 +1,6 @@ import os import textwrap -from typing import Sequence +from typing import Sequence, Any, List, Optional import pytest @@ -643,6 +643,8 @@ def test_system_service_detection() -> None: systemd_service_system_dir = f"{systemd_service_root_dir}/system" systemd_service_user_dir = f"{systemd_service_root_dir}/user" + services: List[DetectedService[Optional[object]]] + services, _ = plugin.run_service_detection_and_integrations( "systemd", build_virtual_file_system([]) ) @@ -704,7 +706,9 @@ def test_system_service_detection() -> None: assert foo_service.enable_by_default assert foo_service.start_by_default assert foo_service.default_upgrade_rule == "restart" - assert foo_service.service_context.had_install_section + foo_service_context = foo_service.service_context + assert isinstance(foo_service_context, SystemdServiceContext) + assert foo_service_context.had_install_section bar_timer = _extract_service(services, "bar.timer") assert set(bar_timer.names) == {"bar.timer"} @@ -713,7 +717,9 @@ def test_system_service_detection() -> None: assert not bar_timer.enable_by_default assert bar_timer.start_by_default assert bar_timer.default_upgrade_rule == "restart" - assert not bar_timer.service_context.had_install_section + bar_service_context = bar_timer.service_context + assert isinstance(bar_service_context, SystemdServiceContext) + assert not bar_service_context.had_install_section snippets = metadata.maintscripts() assert len(snippets) == 4 @@ -742,6 +748,8 @@ def test_sysv_service_detection() -> None: ) init_dir = "etc/init.d" + services: List[DetectedService[Optional[object]]] + services, _ = plugin.run_service_detection_and_integrations( "sysvinit", build_virtual_file_system([]) ) @@ -1135,9 +1143,9 @@ def test_pam_auth_update() -> None: assert postinst.registration_method == "on_configure" assert "pam-auth-update --package" in postinst.plugin_provided_script - prerms = prerms[0] - assert prerms.registration_method == "on_before_removal" - assert "pam-auth-update --package --remove foo-pam" in prerms.plugin_provided_script + prerm = prerms[0] + assert prerm.registration_method == "on_before_removal" + assert "pam-auth-update --package --remove foo-pam" in prerm.plugin_provided_script def test_auto_depends_solink() -> None: |