File gh-pr2076-2_host-key-policy-test.patch of Package python-Fabric

From 9c915064babc30daed6ea22431ab02d3626d5d3c Mon Sep 17 00:00:00 2001
From: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
Date: Thu, 24 Apr 2025 01:47:39 +0200
Subject: [PATCH] Assert new default host key policy

Since the default policy was changed, reference the new value to
repair the test assertion.

Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
---
 tests/connection.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/connection.py b/tests/connection.py
index 54388d1549d0..4821099aa5a8 100644
--- a/tests/connection.py
+++ b/tests/connection.py
@@ -8,7 +8,7 @@ import socket
 import time
 
 from unittest.mock import patch, Mock, call, ANY
-from paramiko.client import SSHClient, AutoAddPolicy
+from paramiko.client import SSHClient, RejectPolicy
 from paramiko import SSHConfig
 import pytest  # for mark, internal raises
 from pytest import skip, param
@@ -65,7 +65,7 @@ class Connection_:
         def defaults_to_auto_add(self):
             # TODO: change Paramiko API so this isn't a private access
             # TODO: maybe just merge with the __init__ test that is similar
-            assert isinstance(Connection("host").client._policy, AutoAddPolicy)
+            assert isinstance(Connection("host").client._policy, RejectPolicy)
 
     class init:
         "__init__"
-- 
2.49.0

openSUSE Build Service is sponsored by