Esempio n. 1
0
def test_get_int_should_return_raise_exception_for_invalid_strings():
    with pytest.raises(ValueError):
        config = TimeWarriorConfig({'KEY': 'bla'})

        config.get_int('KEY', 2)
Esempio n. 2
0
def test_get_int_should_return_default_if_key_not_available():
    config = TimeWarriorConfig({'BAR': '1'})

    assert config.get_int('FOO', 2) == 2
Esempio n. 3
0
def test_get_int_should_return_value_for_valid_strings():
    config = TimeWarriorConfig({'KEY': '1'})

    assert config.get_int('KEY', 2) == 1