Example #1
0
def test_TrafficControl_validate_bandwidth_rate_normal(value):
    tc_obj = TrafficControl(
        "dummy",
        bandwidth_rate=value,
        direction=TrafficDirection.OUTGOING,
        shaping_algorithm=ShapingAlgorithm.HTB,
    )
    tc_obj.validate_bandwidth_rate()
Example #2
0
def test_TrafficControl_validate_bandwidth_rate_exception_2(value, expected):
    with pytest.raises(expected):
        tc_obj = TrafficControl(
            "dummy",
            bandwidth_rate=value,
            latency_time=Tc.ValueRange.LatencyTime.MIN,
            latency_distro_time=Tc.ValueRange.LatencyTime.MIN,
            shaping_algorithm=ShapingAlgorithm.HTB)
        tc_obj.validate_bandwidth_rate()
Example #3
0
def test_TrafficControl_validate_bandwidth_rate_exception_2(value, expected):
    tc_obj = TrafficControl("dummy", bandwidth_rate=value)
    with pytest.raises(expected):
        tc_obj.validate_bandwidth_rate()
Example #4
0
def test_TrafficControl_validate_bandwidth_rate_normal(value):
    tc_obj = TrafficControl("dummy", bandwidth_rate=value)
    tc_obj.validate_bandwidth_rate()
Example #5
0
def test_TrafficControl_validate_bandwidth_rate_exception_1(value, expected):
    with pytest.raises(expected):
        tc_obj = TrafficControl(
            "dummy", bandwidth_rate=value, direction=TrafficDirection.OUTGOING)
        tc_obj.validate_bandwidth_rate()
Example #6
0
def test_TrafficControl_validate_bandwidth_rate_normal(value):
    tc_obj = TrafficControl(
        "dummy", bandwidth_rate=value, direction=TrafficDirection.OUTGOING)
    tc_obj.validate_bandwidth_rate()