def address(self): bind = self.settings['bind'].get() return util.parse_address(util.to_bytestring(bind))
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)
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
def address(self): bind = self.settings['bind'].get() return util.parse_address(bytes_to_str(bind))
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']))
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'