connectiopn fix round 2 2

This commit is contained in:
2026-08-21 15:23:46 +02:00
parent 6b2c5ac8a2
commit 8c9af78672
4 changed files with 297 additions and 19 deletions

View File

@ -161,7 +161,7 @@ async def test_discovery_braucht_keine_anmeldung(tmp_path, monkeypatch):
async def _fake_connect(*a, **kw): # pragma: no cover - darf nicht laufen
raise AssertionError("Die Ermittlung darf keine Anmeldung mehr versuchen")
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
assert (host, port) == ("185.228.139.3", 22)
return FakeHostKey()
@ -183,7 +183,7 @@ async def test_discovery_braucht_keine_anmeldung(tmp_path, monkeypatch):
async def test_discovery_meldet_echte_unerreichbarkeit(tmp_path, monkeypatch):
import asyncssh
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
raise OSError("Connection refused")
monkeypatch.setattr(asyncssh, "get_server_host_key", _fake_get_host_key, raising=False)
@ -219,7 +219,7 @@ async def test_abweichender_hostkey_bricht_vor_der_anmeldung_ab(tmp_path, monkey
versuche.append(kw)
raise AssertionError("Bei abweichendem Host-Key darf keine Anmeldung erfolgen")
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
return FakeHostKey(fingerprint="SHA256:einVoelligAndererSchluessel", public="ssh-ed25519 AAAAfremd x")
monkeypatch.setattr(asyncssh, "connect", _fake_connect)
@ -242,7 +242,7 @@ async def test_verbindung_nutzt_benutzernamen_der_zugangsdaten(tmp_path, monkeyp
aufrufe.update(kw)
return FakeConnectionResult()
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
return FakeHostKey()
monkeypatch.setattr(asyncssh, "connect", _fake_connect)
@ -262,7 +262,7 @@ async def test_hostkey_wechsel_nach_der_pruefung_beendet_die_sitzung(tmp_path, m
async def _fake_connect(address, **kw):
return verbindung
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
return FakeHostKey()
monkeypatch.setattr(asyncssh, "connect", _fake_connect)
@ -283,7 +283,7 @@ async def test_altbestand_ohne_gespeicherten_hostkey_wird_nachgetragen(tmp_path,
async def _fake_connect(address, **kw):
return FakeConnectionResult()
async def _fake_get_host_key(host, port=22, **kw):
async def _fake_get_host_key(host, port=22): # bewusst OHNE **kw -- siehe test_phase14.py
return FakeHostKey()
monkeypatch.setattr(asyncssh, "connect", _fake_connect)