From c5bd19f2426b5717fd14798de6979977f3e0297c Mon Sep 17 00:00:00 2001 From: waterflow80 Date: Thu, 24 Oct 2024 15:23:12 +0100 Subject: [PATCH] Mock spacewak gpg home directory Mocked the SPACEWALK_GPG_HOMEDIR value to `~/gnupg/`, which is the default directory for gpg, in order to execute the gpg tests outside the uyuni-server --- python/lzreposync/tests/test_lzreposync.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/lzreposync/tests/test_lzreposync.py b/python/lzreposync/tests/test_lzreposync.py index 4a0bf01f6eb..995169e4d18 100644 --- a/python/lzreposync/tests/test_lzreposync.py +++ b/python/lzreposync/tests/test_lzreposync.py @@ -7,6 +7,7 @@ import shutil import time import unittest +from unittest.mock import patch import pytest from psycopg2 import errors @@ -1093,6 +1094,7 @@ def test_get_repositories_by_channel_label(self): self.assertEqual(repo_url, repo.source_url) self.assertEqual("N", repo.metadata_singed) + @patch('lzreposync.rpm_repo.SPACEWALK_GPG_HOMEDIR', '~/.gnupg/') def test_has_valid_gpg_signature(self): """ NOTE!: to successfully run this test, you should have already added