def test_is_valid_proxy_false(self): self.assertFalse(ProxySelector.is_valid_proxy("1.1.1.1.1:5050")) self.assertFalse(ProxySelector.is_valid_proxy("8.8.8.8:65536")) self.assertFalse(ProxySelector.is_valid_proxy("1.1.1.1:0000")) self.assertFalse(ProxySelector.is_valid_proxy("1.1.1.1:-100")) self.assertFalse(ProxySelector.is_valid_proxy("abcdefg")) self.assertFalse(ProxySelector.is_valid_proxy("")) self.assertFalse(ProxySelector.is_valid_proxy(None))
def test_is_valid_proxy_true(self): self.assertTrue(ProxySelector.is_valid_proxy("127.0.0.1:8080")) self.assertTrue(ProxySelector.is_valid_proxy("192.168.0.0:65535")) self.assertTrue(ProxySelector.is_valid_proxy("80.80.80.80:1337"))