示例#1
0
def test_release_darwin_udp_port():
    """Due to dynamips / darwin bug we didn't free the port"""
    pm = PortManager()
    project = Project()
    pm.reserve_udp_port(4242, project)
    pm.release_udp_port(4242, project)
    with pytest.raises(aiohttp.web.HTTPConflict):
        pm.reserve_udp_port(4242, project)
示例#2
0
def test_reserve_udp_port_outside_range():
    pm = PortManager()
    project = Project()
    with pytest.raises(aiohttp.web.HTTPConflict):
        pm.reserve_udp_port(80, project)
示例#3
0
def test_reserve_udp_port():
    pm = PortManager()
    project = Project()
    pm.reserve_udp_port(10000, project)
    with pytest.raises(aiohttp.web.HTTPConflict):
        pm.reserve_udp_port(10000, project)
示例#4
0
def test_release_udp_port():
    pm = PortManager()
    project = Project()
    pm.reserve_udp_port(10000, project)
    pm.release_udp_port(10000, project)
    pm.reserve_udp_port(10000, project)
示例#5
0
def test_release_udp_port():
    pm = PortManager()
    project = Project()
    pm.reserve_udp_port(4242, project)
    pm.release_udp_port(4242, project)
    pm.reserve_udp_port(4242, project)
示例#6
0
def test_reserve_udp_port():
    pm = PortManager()
    project = Project()
    pm.reserve_udp_port(4242, project)
    with pytest.raises(aiohttp.web.HTTPConflict):
        pm.reserve_udp_port(4242, project)
def test_reserve_udp_port_outside_range():
    pm = PortManager()
    project = Project()
    with pytest.raises(aiohttp.web.HTTPConflict):
        pm.reserve_udp_port(80, project)