Exemple #1
0
def test_boolean():
    assert utils.boolean('true')
    assert utils.boolean('True')
    assert utils.boolean('TRUE')
    assert not utils.boolean('false')
    assert not utils.boolean('False')
    assert not utils.boolean('FALSE')

    with pytest.raises(ValueError):
        utils.boolean('foo')

    with pytest.raises(ValueError):
        utils.boolean(None)
Exemple #2
0
def test_boolean():
    assert utils.boolean("true")
    assert utils.boolean("True")
    assert utils.boolean("TRUE")
    assert not utils.boolean("false")
    assert not utils.boolean("False")
    assert not utils.boolean("FALSE")

    with pytest.raises(ValueError):
        utils.boolean("foo")

    with pytest.raises(ValueError):
        utils.boolean(None)
Exemple #3
0
def test_boolean():
    assert utils.boolean('true')
    assert not utils.boolean('false')
Exemple #4
0
def test_boolean():
    assert utils.boolean('true')
    assert utils.boolean('True')
    assert utils.boolean('TRUE')
    assert utils.boolean(True)
    assert not utils.boolean('false')
    assert not utils.boolean('False')
    assert not utils.boolean('FALSE')
    assert not utils.boolean(False)

    with pytest.raises(ValueError):
        utils.boolean('foo')

    with pytest.raises(ValueError):
        utils.boolean(None)