Hello, I just finished the Python Port Scanner project and it passed the web validator.
The fun fact is that it was failing one test in replit. I looked at the test code and I think it is not correctly implemented.
def test_port_scanner_verbose_ip_hostname_returned_multiple_ports(self): str = port_scanner.get_open_ports("220.127.116.11", [440, 450], True) actual = str expected = "Open ports for hackthissite.org (18.104.22.168)\nPORT SERVICE\n443 https" self.assertEqual(actual, expected, "Expected 'Open ports for hackthissite.org (22.214.171.124)\nPORT SERVICE\n443 https'")
As you can see the first argument for port_scanner.get_open_ports is the IP address but in the expected answer it require the Hostname + IP address. Either change the first parameter to the hostname or the answer to expect only IP, otherwise it will not work if we complete the project according to the given info. Also the function title is not what the result expect: Test port_scanner verbose ip HOSTNAME returned MULTIPLE PORTS. It doesn’t have hostname and don’t expect multiple ports returned, just one opened.