check this string is within ip format
(ip)
| 17 | |
| 18 | |
| 19 | def is_ip_valid(ip): |
| 20 | """ |
| 21 | check this string is within ip format |
| 22 | """ |
| 23 | if is_auth_proxy(ip): |
| 24 | ip = ip.split('@')[1] |
| 25 | a = ip.split('.') |
| 26 | if len(a) != 4: |
| 27 | return False |
| 28 | for x in a: |
| 29 | if not x.isdigit(): |
| 30 | return False |
| 31 | i = int(x) |
| 32 | if i < 0 or i > 255: |
| 33 | return False |
| 34 | return True |
| 35 | |
| 36 | |
| 37 | def is_port_valid(port): |
no test coverage detected