Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring Ip.py to return proper boolean values #1043

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pUrGe12
Copy link
Contributor

@pUrGe12 pUrGe12 commented Mar 11, 2025

Proposed change

Currently the ip.py file has functions that are return boolean values to determine valid IP addresses. In functions like is_ipv4_range, its using and with netaddr.IPNetwork() which returns an IPNetwork object and not a boolean. This hasn't affected any functionality because its always being used as if is_ipv4_range(ip) which results in true as long as the function doesn't return False, but for tests it will be necessary.

Type of change

  • New core framework functionality
  • Bugfix (non-breaking change which fixes an issue)
  • Code refactoring without any functionality changes
  • New or existing module/payload change
  • Localization improvement
  • Dependency upgrade
  • Documentation improvement

Checklist

  • I've followed the contributing guidelines
  • I've run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

@pUrGe12 pUrGe12 changed the title Ip tests Created tests for Ip.py Mar 11, 2025
@securestep9
Copy link
Collaborator

securestep9 commented Mar 19, 2025

please don't mix the tests with core functionality refactoring in one PR.

@pUrGe12
Copy link
Contributor Author

pUrGe12 commented Mar 19, 2025

I'll keep this one only to refactoring the ip.py file to make it suitable for the tests.

@pUrGe12 pUrGe12 changed the title Created tests for Ip.py Refactoring Ip.py to return proper boolean values Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants