From 785ef7df38eeb8f3fe9ff2e39ce59d0167550bde Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Sun, 30 Mar 2025 08:55:41 -0400 Subject: [PATCH 1/2] fix potential stall in test_gssapi.py --- tests/test_lib/test_gssapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_lib/test_gssapi.py b/tests/test_lib/test_gssapi.py index b4ad3adc..e5162a98 100644 --- a/tests/test_lib/test_gssapi.py +++ b/tests/test_lib/test_gssapi.py @@ -15,6 +15,8 @@ class TestGSSAPI(unittest.TestCase): self.session = koji.ClientSession('https://koji.example.com/kojihub', {}) self.session._callMethod = mock.MagicMock(name='_callMethod') + self.session.logout = mock.MagicMock(name='logout') + # logout bypasses _callMethod. mock needed for __del__ to work def tearDown(self): mock.patch.stopall() From c8e1ca7732de55e99d5fe43b57974beb9bf70924 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Sun, 30 Mar 2025 09:50:37 -0400 Subject: [PATCH 2/2] fix pathinfo side effect from unit test --- tests/test_hub/test_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_hub/test_config.py b/tests/test_hub/test_config.py index b3a530ec..4aa8a31d 100644 --- a/tests/test_hub/test_config.py +++ b/tests/test_hub/test_config.py @@ -14,6 +14,9 @@ class TestHubConfig(unittest.TestCase): def setUp(self): self.context = mock.patch('kojihub.kojihub.context').start() + # load_config modfies pathinfo, make sure it is restored + mock.patch('koji.pathinfo').start() + mock.patch('koji.BASEDIR').start() self.tempdir = tempfile.mkdtemp() self.environ = { 'koji.hub.ConfigFile': self.tempdir + '/hub.conf',