示例#1
0
 def address(self):
     bind = self.settings['bind'].get()
     return util.parse_address(util.to_bytestring(bind))
示例#2
0
 def address(self):
     s = self.settings['bind'].get()
     return [util.parse_address(_compat.bytes_to_str(bind)) for bind in s]
示例#3
0
 def address(self):
     bind = self.settings['bind'].get()
     return util.parse_address(util.to_bytestring(bind))
示例#4
0
 def address(self):
     s = self.settings['bind'].get()
     return [util.parse_address(_compat.bytes_to_str(bind)) for bind in s]
def test_parse_address_invalid():
    with pytest.raises(RuntimeError) as err:
        util.parse_address('127.0.0.1:test')
    assert "'test' is not a valid port number." in str(err)
def test_parse_fd_invalid():
    with pytest.raises(RuntimeError) as err:
        util.parse_address('fd://asd')
    assert "'asd' is not a valid file descriptor." in str(err)
示例#7
0
 def address(self):
     s = self.settings["bind"].get()
     return [util.parse_address(six.bytes_to_str(bind)) for bind in s]
def test_parse_address(test_input, expected):
    assert util.parse_address(test_input) == expected
示例#9
0
 def address(self):
     bind = self.settings['bind'].get()
     return util.parse_address(bytes_to_str(bind))
示例#10
0
 def address(self):
     bind = self.settings['bind'].get()
     return util.parse_address(bytes_to_str(bind))
示例#11
0
 def address(self):
     if not self.conf['bind']:
         raise RuntimeError("Listener address is not set")
     return util.parse_address(util.to_bytestring(self.conf['bind']))
示例#12
0
def test_parse_fd_invalid():
    with pytest.raises(RuntimeError) as err:
        util.parse_address('fd://asd')
    assert "'asd' is not a valid file descriptor." in str(err)
示例#13
0
def test_parse_address_invalid():
    with pytest.raises(RuntimeError) as err:
        util.parse_address('127.0.0.1:test')
    assert "'test' is not a valid port number." in str(err)
示例#14
0
def test_parse_address(test_input, expected):
    assert util.parse_address(test_input) == expected
示例#15
0
def test_parse_address():
    # Test unix socket addresses (PR #1623)
    assert util.parse_address('unix://var/run/test.sock') == 'var/run/test.sock'
    assert util.parse_address('unix:/var/run/test.sock') == '/var/run/test.sock'