From 779b38178ecb3b0cc4ff65188a5f44c37d9d9c9d Mon Sep 17 00:00:00 2001 From: Joscha Schmiedt <joscha@schmiedt.dev> Date: Wed, 27 Nov 2024 23:04:33 +0100 Subject: [PATCH] TST: Skip sendmail test on Windows --- unittests/test_sss_helper.py | 5 +++-- unittests/test_utils.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/unittests/test_sss_helper.py b/unittests/test_sss_helper.py index c040f503..e1ce286d 100644 --- a/unittests/test_sss_helper.py +++ b/unittests/test_sss_helper.py @@ -2,7 +2,7 @@ import subprocess from email import message_from_file, policy from os import listdir, remove from os.path import abspath, dirname, exists, isfile, join - +import platform import linkahead as db from caosadvancedtools.serverside.helper import (NameCollector, get_data, get_file_via_download, @@ -85,7 +85,8 @@ def test_send_mail(): assert msg["Subject"] == "the subject" assert msg.get_content() == "hello!\n" - +# skip on windows (has no sendmail) +@mark.skipif(platform.system() == "Windows") def test_send_mail_error(): with raises(subprocess.CalledProcessError): send_mail("me@example.com", "you@example.com", "the subject", "hello!", diff --git a/unittests/test_utils.py b/unittests/test_utils.py index c8134e3d..aeae08e4 100644 --- a/unittests/test_utils.py +++ b/unittests/test_utils.py @@ -77,7 +77,7 @@ class ReferencesBaseTest(BaseMockUpTest): files = get_referenced_files("test.npy", prefix=None, filename=None, location=None) self.assertEqual(len(files), 1) - self.assertEqual(os.path.join(files[0].path, "some", "path", "test.npy")) + self.assertEqual(files[0].path, "/some/path/test.npy") log = self.get_log() assert "FIND file which" in log assert "does not allow a search" not in log -- GitLab