def test_parse_invalid_address(self): host = Host(self.host_str) with self.assertRaises(InvalidAddressError) as cm: host._parse('12:.0.0.1:11211') self.assertEqual(str(cm.exception), 'Invalid address')
def test_parse_invalid_port(self): host = Host(self.host_str) with self.assertRaises(InvalidPortError) as cm: host._parse('127.0.0.1:xx') self.assertEqual(str(cm.exception), 'Invalid port')
def test_parse_ok(self): host = Host(self.host_str) host._parse(self.host_str)