Beispiel #1
0
def test_no_timeouts():
    assert (calculate_timeout_seconds(
        timeouts_enabled=False,
        target_timeout=10,
        timeout_default=1,
        timeout_maximum=2,
    ) is None)
Beispiel #2
0
def test_no_configured_timeouts():
    assert (calculate_timeout_seconds(
        timeouts_enabled=True,
        target_timeout=None,
        timeout_default=None,
        timeout_maximum=2,
    ) is None)
Beispiel #3
0
def test_configured_timeout_greater_than_max():
    assert (calculate_timeout_seconds(
        timeouts_enabled=True,
        target_timeout=10,
        timeout_default=1,
        timeout_maximum=2,
    ) == 2)
Beispiel #4
0
def test_no_maximum_timeout():
    assert (calculate_timeout_seconds(
        timeouts_enabled=True,
        target_timeout=1,
        timeout_default=2,
        timeout_maximum=None,
    ) == 1)
Beispiel #5
0
def test_no_configured_target_timeout_with_bad_default():
    assert (calculate_timeout_seconds(
        timeouts_enabled=True,
        target_timeout=None,
        timeout_default=10,
        timeout_maximum=2,
    ) == 2)
Beispiel #6
0
def test_good_target_timeout():
    assert (calculate_timeout_seconds(
        timeouts_enabled=True,
        target_timeout=2,
        timeout_default=1,
        timeout_maximum=10,
    ) == 2)