예제 #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
파일: config.py 프로젝트: lericson/gunicorn
 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'