Add unit tests for HostEntry and HostsFile models, and implement HostsParser tests
- Created comprehensive unit tests for HostEntry class, covering creation, validation, and conversion to/from hosts file lines. - Developed unit tests for HostsFile class, including entry management, sorting, and retrieval of active/inactive entries. - Implemented tests for HostsParser class, validating parsing and serialization of hosts files, handling comments, and file operations. - Ensured coverage for edge cases such as empty files, invalid entries, and file permission checks.
This commit is contained in:
parent
40a1e67949
commit
2decad8047
21 changed files with 1691 additions and 75 deletions
BIN
tests/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
tests/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
tests/__pycache__/test_models.cpython-313-pytest-8.4.1.pyc
Normal file
BIN
tests/__pycache__/test_models.cpython-313-pytest-8.4.1.pyc
Normal file
Binary file not shown.
BIN
tests/__pycache__/test_parser.cpython-313-pytest-8.4.1.pyc
Normal file
BIN
tests/__pycache__/test_parser.cpython-313-pytest-8.4.1.pyc
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue