Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
 def test_parse_ok(self):
     host = Host(self.host_str)
     host._parse(self.host_str)