mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 18:02:04 +03:00
Remove unused resolved_ip from PmtuResult dataclass
Removes the unused `resolved_ip` field from the `PmtuResult` model in `src/netsleuth/models.py`, which is a clean-up refactoring for code health. The assignment in `src/netsleuth/probes/pmtud.py` and test instantiations in `tests/test_pmtud.py` were also removed accordingly. Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
parent
8c99ac78b7
commit
9bdb84d002
3 changed files with 1 additions and 3 deletions
|
|
@ -538,7 +538,6 @@ class QuicResult:
|
||||||
@dataclass
|
@dataclass
|
||||||
class PmtuResult:
|
class PmtuResult:
|
||||||
host: str
|
host: str
|
||||||
resolved_ip: str | None = None
|
|
||||||
method: str = "none"
|
method: str = "none"
|
||||||
discovered_mtu: int | None = None
|
discovered_mtu: int | None = None
|
||||||
iface_mtu: int | None = None
|
iface_mtu: int | None = None
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,6 @@ async def probe_pmtu(
|
||||||
result.note = f"could not resolve {host}: {exc}"
|
result.note = f"could not resolve {host}: {exc}"
|
||||||
result.note_ru = f"не удалось разрешить {host}: {exc}"
|
result.note_ru = f"не удалось разрешить {host}: {exc}"
|
||||||
return result
|
return result
|
||||||
result.resolved_ip = resolved_ip
|
|
||||||
|
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
result.method = "icmp_win" if system == "Windows" else "system_ping"
|
result.method = "icmp_win" if system == "Windows" else "system_ping"
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ def test_unix_ping_df_argv_rounds_a_fractional_timeout_up():
|
||||||
|
|
||||||
|
|
||||||
def pmtu(**kw) -> PmtuResult:
|
def pmtu(**kw) -> PmtuResult:
|
||||||
base = dict(host="example.com", resolved_ip="1.2.3.4", method="icmp_win", verdict="unknown")
|
base = dict(host="example.com", method="icmp_win", verdict="unknown")
|
||||||
base.update(kw)
|
base.update(kw)
|
||||||
return PmtuResult(**base)
|
return PmtuResult(**base)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue