示例#1
0
 def test_crate12_psql(self):
     self.assertEqual(AddrConsumer._parse(crate12_psql),
                      ('psql', '127.0.0.1:5432'))
     self.assertEqual(AddrConsumer._parse(crate12_http),
                      ('http', '127.0.0.1:4200'))
     self.assertEqual(AddrConsumer._parse(crate12_transport),
                      ('transport', '127.0.0.1:4300'))
示例#2
0
 def test_ipv6_psql(self):
     self.assertEqual(AddrConsumer._parse(ipv6_psql), ('psql', '[::1]:5432'))
示例#3
0
 def test_ipv6_http(self):
     self.assertEqual(AddrConsumer._parse(ipv6_http), ('http', '[::1]:44200'))
示例#4
0
 def test_crate12_psql(self):
     self.assertEqual(AddrConsumer._parse(crate12_psql), ('psql', '127.0.0.1:5432'))
     self.assertEqual(AddrConsumer._parse(crate12_http), ('http', '127.0.0.1:4200'))
     self.assertEqual(AddrConsumer._parse(crate12_transport), ('transport', '127.0.0.1:4300'))
示例#5
0
def get_match(lines):
    for line in lines:
        protocol, addr = AddrConsumer._parse(line)
        if protocol:
            return protocol, addr
示例#6
0
 def test_ipv6_psql(self):
     self.assertEqual(AddrConsumer._parse(ipv6_psql),
                      ('psql', '[::1]:5432'))
示例#7
0
 def test_ipv6_http(self):
     self.assertEqual(AddrConsumer._parse(ipv6_http),
                      ('http', '[::1]:44200'))
示例#8
0
def get_match(lines):
    for line in lines:
        protocol, addr = AddrConsumer._parse(line)
        if protocol:
            return protocol, addr