def test_mode_none():
    assert sanitize_mode(mode=MODE_NONE) is None
def test_mode_float_valid():
    assert sanitize_mode(
        mode=MODE_FLOAT_VALID) == pytest.approx(MODE_FLOAT_VALID)
def test_mode_float_invalid():
    assert sanitize_mode(mode=MODE_FLOAT_INVALID) is None
def test_mode_int_invalid():
    assert sanitize_mode(mode=MODE_INT_INVALID) is None
def test_mode_int_valid():
    assert sanitize_mode(mode=MODE_INT_VALID) == pytest.approx(
        float(MODE_INT_VALID))
def test_mode_str_invalid():
    assert sanitize_mode(mode=MODE_STR_INVALID) is None
def test_mode_str_valid():
    assert sanitize_mode(mode=MODE_STR_VALID) == pytest.approx(
        float(Mode[MODE_STR_VALID].value))
def test_mode_valid():
    assert sanitize_mode(mode=MODE_VALID) == pytest.approx(
        float(MODE_VALID.value))