Refactor test cases for improved readability and consistency

- Updated test_dns.py to enhance mock function definitions and improve spacing for better readability.
- Modified test_filters.py to streamline assertions and ensure consistent formatting across test cases.
- Cleaned up test_import_export.py by organizing imports and ensuring consistent formatting in CSV and JSON tests.
- Improved test_main.py by refining mock setups and ensuring consistent error handling in assertions.
This commit is contained in:
Philip Henning 2026-09-03 12:47:11 +02:00
parent 0710d10fac
commit 7872991e0b
42 changed files with 2376 additions and 2735 deletions

65
CONTEXT.md Normal file
View file

@ -0,0 +1,65 @@
# Hosts Management
This context describes the language used by the terminal application that
manages the system hosts file. These terms distinguish operating-system host
mappings from application modes and DNS-derived mappings.
## Language
**Hosts File**:
The system file containing local mappings from IP addresses to hostnames.
_Avoid_: Host database, configuration file
**Host Entry**:
One IP-address mapping with one or more hostnames and an optional comment.
_Avoid_: Record, row
**Canonical Hostname**:
The first hostname in a Host Entry and the primary name displayed for it.
_Avoid_: Primary domain, main host
**Alias**:
Any hostname after the Canonical Hostname in the same Host Entry.
_Avoid_: Secondary domain, alternate entry
**Active Entry**:
A Host Entry whose mapping participates in host resolution because its line is
not commented out.
_Avoid_: Enabled host
**Inactive Entry**:
A Host Entry retained in the Hosts File as a commented-out mapping.
_Avoid_: Disabled host, deleted entry
**Default Entry**:
A protected Host Entry representing a baseline localhost or broadcasthost
mapping expected by the operating system.
_Avoid_: Built-in row, standard record
**DNS Entry**:
A Host Entry whose IP address is derived from a configured DNS name and then
stored as a normal hosts mapping.
_Avoid_: CNAME, dynamic host
**Resolved IP**:
The IP address most recently obtained for a DNS Entry's configured DNS name.
_Avoid_: Lookup result, dynamic IP
**Read-only Mode**:
The normal application state in which the Hosts File can be inspected but not
changed.
_Avoid_: View mode, safe mode
**Privileged Mode**:
The application state in which system authorization has been validated and
Host Entries may be changed.
_Avoid_: Edit mode, sudo mode
**Pre-edit Backup**:
A timestamped copy of the Hosts File created before Privileged Mode begins.
_Avoid_: Session backup, safety snapshot
**Entry Editor**:
The form for changing one Host Entry while the application is in Privileged
Mode.
_Avoid_: Edit mode, detail mode