def test_parse_address(source, result): if result is None: with pytest.raises(ConfigurationError) as exc: parse_address(source) assert 'Misconfigured bind address' in str(exc) assert '`foo`' in str(exc) else: assert parse_address(source) == result
def bind_addr(self): _default = '0.0.0.0:8000' address_str = self.container.config.get(WEB_SERVER_CONFIG_KEY, _default) if address_str.startswith('fd://'): address_str = _default return parse_address(address_str)
def web_config_port(web_config): from nameko.constants import WEB_SERVER_CONFIG_KEY from nameko.web.server import parse_address return parse_address(web_config[WEB_SERVER_CONFIG_KEY]).port
def test_web_config(web_config): assert WEB_SERVER_CONFIG_KEY in web_config bind_address = parse_address(web_config[WEB_SERVER_CONFIG_KEY]) sock = socket.socket() sock.bind(bind_address)
def web_config_port(web_config): return parse_address(web_config['WEB_SERVER_ADDRESS']).port
def bind_addr(self): address_str = self.container.config.get( "MANAGEMENT_WEB_SERVER_CONFIG", '0.0.0.0:8980') return parse_address(address_str)