예제 #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')
예제 #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')
예제 #3
0
 def test_parse_ok(self):
     host = Host(self.host_str)
     host._parse(self.host_str)