def test_str2bool():
    """test the str2bool function"""
    assert pomerge.str2bool("yes")
    assert pomerge.str2bool("true")
    assert pomerge.str2bool("1")
    assert not pomerge.str2bool("no")
    assert not pomerge.str2bool("false")
    assert not pomerge.str2bool("0")
    with pytest.raises(ValueError):
        pomerge.str2bool("2")
Exemple #2
0
def test_str2bool():
    """test the str2bool function"""
    assert pomerge.str2bool("yes")
    assert pomerge.str2bool("true")
    assert pomerge.str2bool("1")
    assert not pomerge.str2bool("no")
    assert not pomerge.str2bool("false")
    assert not pomerge.str2bool("0")
    with pytest.raises(ValueError):
        pomerge.str2bool("2")