From f0c0d6dcf54655cade65a9348c09b5ca82a59698 Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Thu, 26 Oct 2017 21:25:13 +0100 Subject: [PATCH] letsencrypt: Disable test when sudo is not available Reviewed-by: Sunil Mohan Adapa --- plinth/modules/letsencrypt/tests/test_domain_name_changes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plinth/modules/letsencrypt/tests/test_domain_name_changes.py b/plinth/modules/letsencrypt/tests/test_domain_name_changes.py index 561ff66dc..5f274d31e 100644 --- a/plinth/modules/letsencrypt/tests/test_domain_name_changes.py +++ b/plinth/modules/letsencrypt/tests/test_domain_name_changes.py @@ -19,13 +19,16 @@ Tests for letsencrypt module. """ import os +import os.path import unittest from .. import on_domain_added, on_domain_removed euid = os.geteuid() +sudo_available = os.path.isfile("/usr/bin/sudo") +@unittest.skipUnless(sudo_available, 'Requires sudo') class TestDomainNameChanges(unittest.TestCase): """Test for automatically obtaining and revoking Let's Encrypt certs"""