Unit tests for ipaddr.py, and add it to the coverage gate #24
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/confconsole#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
ipaddr.py(about 100 lines:is_legal_ip, theIPclass andIPRange) is used by the network screens inconfconsole.py. Today it is only reached by accident from other tests and sits at 36 percent coverage, so the CI gate does not measure it. It is step 2 of the test plan inCOVERAGE.md.What to do
tests/test_ipaddr.pycovering:is_legal_ip: valid IPv4, too few or too many octets, an octet above 255, non-numeric text.IP: built from a string, an int and anotherIP;str()andrepr();+,-,&,|,^.IPRange:from_cidr("192.0.2.0/24"),infor an address inside and outside,fmt_cidr()andstr().Errorraised for an argumentIPdoes not accept.is_legal_ipaccept IPv6 is separate planned work; do not changeipaddr.py.ipaddrto thepackage:list in.github/workflows/tests.ymlso the gate measures it.Done when
ipaddr.pyis at 100 percent line and branch coverage.ipaddris in the measured package list and thetestscheck is green.ipaddr.pyitself is unchanged.Help
Ask in https://github.com/orgs/Keel-Linux/discussions
Hi @marcos-mendez! I'd like to work on this one too. I'll add tests/test_ipaddr.py for is_legal_ip, IP and IPRange, and add ipaddr to the coverage list in tests.yml. Will open a PR shortly.