예제 #1
0
파일: test_utils.py 프로젝트: ralequi/cmd2
def test_str_to_bool_bad_input():
    with pytest.raises(ValueError):
        cu.str_to_bool(1)
예제 #2
0
파일: test_utils.py 프로젝트: ralequi/cmd2
def test_str_to_bool_false():
    assert not cu.str_to_bool('false')
    assert not cu.str_to_bool('False')
    assert not cu.str_to_bool('FALSE')
    assert not cu.str_to_bool('fAlSe')
예제 #3
0
파일: test_utils.py 프로젝트: ralequi/cmd2
def test_str_to_bool_invalid():
    with pytest.raises(ValueError):
        cu.str_to_bool('other')
예제 #4
0
파일: test_utils.py 프로젝트: ralequi/cmd2
def test_str_to_bool_true():
    assert cu.str_to_bool('true')
    assert cu.str_to_bool('True')
    assert cu.str_to_bool('TRUE')
    assert cu.str_to_bool('tRuE')