-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socket_extra: created
isIP
to check if value is IP or not.
- Loading branch information
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import liburing | ||
|
||
|
||
def test_isIP(): | ||
assert liburing.isIP(liburing.AF_INET, b'0.0.0.0') is True | ||
assert liburing.isIP(liburing.AF_INET6, b'::1') is True | ||
assert liburing.isIP(liburing.AF_INET6, b'domain.ext') is False | ||
assert liburing.isIP(liburing.AF_INET, b'domain.ext') is False | ||
assert liburing.isIP(liburing.AF_UNIX, b'/path/socket') is False |