Enhance hosts file serialization and entry formatting for proper tab alignment; update tests to reflect changes.
This commit is contained in:
parent
cead0c1066
commit
5a2e0d2623
4 changed files with 111 additions and 32 deletions
|
@ -67,7 +67,7 @@ class TestHostEntry:
|
|||
comment="Loopback"
|
||||
)
|
||||
line = entry.to_hosts_line()
|
||||
assert line == "127.0.0.1 localhost local # Loopback"
|
||||
assert line == "127.0.0.1\tlocalhost\tlocal\t# Loopback"
|
||||
|
||||
def test_to_hosts_line_inactive(self):
|
||||
"""Test conversion to hosts file line format for inactive entry."""
|
||||
|
@ -77,7 +77,7 @@ class TestHostEntry:
|
|||
is_active=False
|
||||
)
|
||||
line = entry.to_hosts_line()
|
||||
assert line == "# 192.168.1.1 router"
|
||||
assert line == "# 192.168.1.1\trouter"
|
||||
|
||||
def test_from_hosts_line_simple(self):
|
||||
"""Test parsing simple hosts file line."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue